-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: Cannot convert '32' to a shape. #15
Comments
Hello, This error is likely caused by TensorFlow itself, and it seems you might be using an incompatible TensorFlow version. Could you please confirm whether you are using TensorFlow 2.6? If that is indeed the case, could you also provide the steps you followed so that we can reproduce the error on our end? Thank you! |
Thanks for the answer. The version of the Python is: Python 3.10.12 The version of the TensorFlow is: Version: 2.18.0 These can be the root for the issue? |
Yes, the issue is likely due to version incompatibilities, as TensorFlow 2.18.0 and Python 3.10.12 are incompatible with the repository. I recommend using TensorFlow 2.6, which you can install via pip install -r requirements.txt, and downgrading Python to version 3.7 or 3.8, as TensorFlow 2.6 does not support Python 3.10. Let me know if you encounter any issues! |
Thanks a lot. |
It seems that the specific version TensorFlow 2.6 is no longer available on the official Python Package: |
I have downgraded Python to 3.7, but it is not possible to install TensorFlow 2.6, and still the error is there. |
Are you still encountering the same error even after downgrading the Python version? That’s unusual. According to the official TensorFlow installation guide, Python 3.7 should be compatible, and I’ve personally verified this. Let me know if you need further assistance troubleshooting this. |
Thanks a lot for the answer. I have changed the Ubuntu version and could handle that error; however, I am encountering the following error now: 2025-01-22 14:22:50.731900: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2025-01-22 14:22:50.731924: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Traceback (most recent call last): File "main.py", line 6, in
File "../model.py", line 22, in
File "/home/reza/.local/lib/python3.7/site-packages/tensorflow/python/util/lazy_loader.py", line 62, in getattr
File "/home/reza/.local/lib/python3.7/site-packages/tensorflow/python/util/lazy_loader.py", line 45, in _load
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
File "/home/reza/.local/lib/python3.7/site-packages/keras/init.py", line 21, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/models/init.py", line 18, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/engine/functional.py", line 26, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/backend.py", line 34, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/engine/keras_tensor.py", line 19, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/utils/init.py", line 48, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/utils/layer_utils.py", line 26, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/initializers/init.py", line 22, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/initializers/initializers_v2.py", line 23, in
File "/home/reza/.local/lib/python3.7/site-packages/keras/dtensor/init.py", line 22, in
ImportError: cannot import name 'dtensor' from 'tensorflow.compat.v2.experimental' (/home/reza/.local/lib/python3.7/site-packages/tensorflow/_api/v2/compat/v2/experimental/init.py) |
I think it is because of the old version of TensorFlow (2.6), right? |
I could handle it by downgrading the Keras version! Now the training is working. Now in the prediction file, I encounter: ModuleNotFoundError: No module named 'read_dataset' |
Hello there,
What can be the cause for the following error?
ValueError: Cannot convert '32' to a shape.
Thanks
The text was updated successfully, but these errors were encountered: