My TX2 makes the following error when running “from tensorflow.keras import layers” :“ImportError: cannot import name ‘dtensor’”, tensorflow is version 2.7, is this the version problem? What is the solution,
When running on a PC, tensorflow is version 2.12, and keras is not installed separately, and everything is fine
Maybe the below link can help you:
The latest tensorflow should include keras. I have never installed KERAS separately on PC, so there is no version mapping relationship. Does tensorflow2.7 not include KERAS, do I need to install keras separately? What is the keras version number corresponding to tensorlfow2.7, if required?
How do I check the keras version，“ ImportError: cannot import name ‘dtensor’” is still reported when running “print(keras.version)”
We just give it a try.
Reinstalling Keras with 2.6 can fix this issue.
$ pip3 install keras==2.6
Defaulting to user installation because normal site-packages is not writeable
Downloading keras-2.6.0-py2.py3-none-any.whl (1.3 MB)
|████████████████████████████████| 1.3 MB 1.9 MB/s
Installing collected packages: keras
Successfully installed keras-2.6.0
Python 3.6.9 (default, Mar 10 2023, 16:46:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.