You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/usr/lib/python3.10/importlib/_bootstrap.py in _gcd_import(name, package, level)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load(name, import_)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
/usr/lib/python3.10/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)
/usr/lib/python3.10/importlib/_bootstrap.py in _gcd_import(name, package, level)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load(name, import_)
/usr/lib/python3.10/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)
ModuleNotFoundError: No module named 'keras.legacy_tf_layers'
Which version of TensorFlow do you have installed (and how did you install DeepLabCut)?
I believe this is an error linked with an incompatible version of Tensorflow being installed. You should install tensorflow version <=2.12, so one easy fix would be running pip install --upgrade "tensorflow<=2.10" (on Google Colab/Windows/Linux machines).
For reference, on Apple computers with M1/M2 chips, you would need to run pip install --upgrade "tensorflow-macos<2.13.0".
Many thanks for the clarification. Looks like the above solution worked. Outlining steps for others. The bug came in place as google has updated colab to tensorflow 2.13.0.
from google.colab import drive
drive.mount('/content/drive')
!pip install deeplabcut
!pip install --upgrade "tensorflow<=2.10"
Rest steps same as mentioned in the bug report. Training started after that for me so I would say this issue can be closed. Thanks again for the help.
Is there an existing issue for this?
Bug description
ModuleNotFoundError: No module named 'keras.legacy_tf_layers'
Google Colab!
Operating System
operating system: Google Colab
DeepLabCut version
dlc version: 2.3.5
DeepLabCut mode
single animal
Device type
gpu: Nvidia Tesla V100
Steps To Reproduce
from google.colab import drive
drive.mount('/content/drive')
!pip install deeplabcut
import os
import deeplabcut
!unzip 'MyProject.zip'
config_path = '/content/MyProject/config.yaml'
deeplabcut.create_training_dataset(
config_path,
num_shuffles=1,
net_type="resnet_50",
augmenter_type='imgaug'
)
deeplabcut.train_network(config_path,
shuffle=1,
trainingsetindex=0,
gputouse=None,
max_snapshots_to_keep=3,
autotune=False,
displayiters=10,
saveiters=1000,
maxiters=10000,
allow_growth=True)
Relevant log output
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: