Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'dtensor' from 'tensorflow.compat.v2.experimental'

I'm trying to create object detection using tensorflow as an assignment.

ImportError: cannot import name 'dtensor' from 'tensorflow.compat.v2.experimental' (c:\Project\.venv\lib\site-packages\tensorflow\_api\v2\compat\v2\experimental\__init__.py) I would appreciate any help!

like image 855
Swaroop Krishna Avatar asked Oct 15 '25 14:10

Swaroop Krishna


1 Answers

I got the same error. I downgraded to Keras v2.6.0, which fixed the issue. Hence, as of 16.05.2022, this seems to be caues by a bug in v2.9.*

To downgrade to v2.6.0, run:

!pip install keras==2.6.*
like image 152
Anna Madsen Avatar answered Oct 17 '25 02:10

Anna Madsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!