Skip to content

Mixed keras imports causing version conflicts #15

@iAmGiG

Description

@iAmGiG

Problem

Code mixes standalone Keras imports with TensorFlow Keras imports, which can cause version conflicts and unpredictable behavior.

Example in train_og.py:

from keras.models import load_model          # Standalone keras
from tensorflow.keras.models import Model     # TensorFlow keras
from tensorflow.keras.layers import Input, Dense

Files affected:

  • anomaly-detection/train_og.py
  • anomaly-detection/test.py
  • Other training scripts

Fix

Use tensorflow.keras exclusively:

from tensorflow.keras.models import load_model, Model
from tensorflow.keras.layers import Input, Dense

Priority

MODERATE - Can cause model loading failures and compatibility issues

Metadata

Metadata

Assignees

Labels

dependenciesDependency updates and compatibilitytechnical-debtTechnical debt and code quality

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions