DeepPoseKit: Attribute Error

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'

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

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()

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'