question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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'

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Cyril9227commented, Mar 29, 2021

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()
1reaction
JoshuaMcGrawcommented, Aug 12, 2020

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'

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix AttributeError in Python - Rollbar
The Python AttributeError is an exception that occurs when an attribute reference or assignment fails. This can occur when an attempt is ...
Read more >
Python AttributeError: A How-To Guide - Career Karma
A Python AttributeError is raised when you try to call an attribute of an object whose type does not support that method. For...
Read more >
Error Encyclopedia | Attribute Error
Attribute errors in Python are generally raised when you try to access or call an attribute that a particular object type doesn't possess....
Read more >
Attribute Error Python - STechies
Attribute error occurs in python when we try to assign an attribute value to a python objects or class instance in which that...
Read more >
The Python AttributeError - Linux Hint
The errors prevent the program from running. One of the most common faults in Python is “Attribute Error”. The AttributeError is defined as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found