jgraving / DeepPoseKit

a toolkit for pose estimation using deep learning
http://deepposekit.org
Apache License 2.0
391 stars 90 forks source link

Attribute Error #62

Open Zumbalamambo opened 4 years ago

Zumbalamambo commented 4 years ago

It's throwing the following error when I tried in Colab.

AttributeError                            Traceback (most recent call last)
<ipython-input-34-d4e8df5c5807> in <module>()
      6     epochs=100,
      7     n_workers=8,
----> 8     steps_per_epoch=200,
      9 )

8 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/callbacks.py in _get_file_path(self, epoch, logs)
   1333                      'Reason: {}'.format(self.filepath, e))
   1334     self._write_filepath = distributed_file_utils.write_filepath(
-> 1335         file_path, self.model.distribute_strategy)
   1336     return self._write_filepath
   1337 

AttributeError: 'DeepLabCut' object has no attribute 'distribute_strategy'
JoshuaMcGraw commented 4 years ago

I am also having this same error - using only the provided example notebook (step3_train_model.ipynb) and data (/deepposekit-data/datasets/fly/).

AttributeError                            Traceback (most recent call last)
<ipython-input-25-8c07752fea11> in <module>()
      6     epochs=200,
      7     n_workers=8,
----> 8     steps_per_epoch=None,
      9 )

8 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/callbacks.py in _get_file_path(self, epoch, logs)
   1333                      'Reason: {}'.format(self.filepath, e))
   1334     self._write_filepath = distributed_file_utils.write_filepath(
-> 1335         file_path, self.model.distribute_strategy)
   1336     return self._write_filepath
   1337 

AttributeError: 'StackedDenseNet' object has no attribute 'distribute_strategy'
Zumbalamambo commented 4 years ago

@JoshuaMcGraw why?

JoshuaMcGraw commented 4 years ago

@JoshuaMcGraw why?

Yes, that certainly is the question. I'll mention that I am using a Conda env with Python 3.8 and Tensorflow 2.3.0 and DeepPoseKit 0.3.9. I have reproduced this error on three different machines using the same versions.

JoshuaMcGraw commented 4 years ago
AttributeError: 'DeepLabCut' object has no attribute 'distribute_strategy'

I suggest running DeepPoseKit with Python <=3.7 and Tensorflow <=2.0.0. It doesn't seem like newer versions are supported.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Zumbalamambo commented 4 years ago

+1 Active issue

JoshuaMcGraw commented 4 years ago

@Zumbalamambo What version of DeepPoseKit, Python, and Tensorflow are you using?

I suggest running DeepPoseKit with Python <=3.7 and Tensorflow <=2.0.0. It doesn't seem like newer versions are supported.

Zumbalamambo commented 4 years ago

@JoshuaMcGraw I use the latest version of tensorflow

eduramiba commented 4 years ago

This happens with tensorflow 2.3.1 at least, but not with 2.2.0

Funkyojo commented 3 years ago

I had the same issue on the Colab notebook step 3 today. Is it possible that you guys fix the notebook?

Cyril9227 commented 3 years ago

Can be fixed when adding :

physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)

model.distribute_strategy = tf.distribute.MirroredStrategy()
ghost commented 2 years ago

Can be fixed when adding :

physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)

model.distribute_strategy = tf.distribute.MirroredStrategy()

hello. Where to put these three lines of code.

liuxi1998 commented 1 year ago

where to put codes> physical_devices = tf.config.list_physical_devices('GPU') tf.config.experimental.set_memory_growth(physical_devices[0], True)

model.distribute_strategy = tf.distribute.MirroredStrategy()