-
Notifications
You must be signed in to change notification settings - Fork 45.6k
NotImplementedError: Cannot convert a symbolic Tensor (strided_slice:0) to a numpy array. #9706
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
Comments
System information I have the same error if I use numpy 1.20.0 if I use numpy 1.19.5 I get Tried with TF 2.2.2 as well in both cases same errors |
fixed using python 3.6 |
Thank you @dademiller360 changing the Python version from 3.8 to 3.6 fixed the issue. |
I have the same problem but when I modify from Python 3.8.5 to 3.6 I get the following error: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace Anybody know how to fix this issue? |
Same issue, but when I switch to Python 3.6 and try to install the Tensorflow Object Detection API using the research/object_detection/packages/tf2/setup.py file, I get this error:
|
In the meantime I solve it by using colab for my object detection. But I would like to be able to use my pc as well |
Have you installed tensorflow correctly? This may be due to C++ executables not present in your system. |
I have the same error as what you are getting. im using numpy 1.20.0 with Tensorflow 2.4.1 I'm convinced that numpy is the problem but im honestly too new at training models and using TF etc. Have you had any luck with solving this issue? |
No, unfortunatly. Just using colab for the moment and hopping that the inference part of tensorflow object detection does work on my computer |
Try to downgrade numpy to
after that, check with |
@dademiller360 The problem is if we do that we get the error mentioned earlier ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from. Some people are able to solve this by downgrading to Python 3.6. But if I do that I get the error from my first post: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace |
Hi @aniketbote I posted this answer in Stack Overflow: https://stackoverflow.com/questions/66373169/tensorflow-2-object-detection-api-numpy-version-errors/66486051#66486051 I had this same issue:
The problem was fixed by changing
Note that you need to import
|
I was able to fix issue like you described but by importing from tensorflow.python.ops.math_ops import reduce_prod
... Seems like it is a bug in |
Hello, I'm new to tf object detection. Fatal Python error: Aborted Thread 0x00007f505b7fe700 (most recent call first): Current thread 0x00007f50f699f740 (most recent call first): Did you face this probled before? Or do you have any idea about this error? |
I fixed this by adding CUDA_VISIBLE_DEVICES="" |
@Pipickin |
I had the same issue with newly installed tensorflow 2.2.0 and python 3.8.5. |
@glemarivero |
perfect, thanks a lot man, just a little touch I had to do: |
Thank you, this method has worked. @Reflectioner your solution also worked. |
It worked 👍 ! In my case array_ops.py was in .../site-packages/tensorflow-core/python/ |
Wonderful. In my case, it works for:
I changed the import from |
I am having the same error, I am also using the latest version of anaconda with TensorFlow version 2.3.0. The program was working with the general installation of TensorFlow with pip. It is not working with anaconda. |
@MeghanshBansal try to replace the lines on |
Idk if this will help anyone, but I also got the I run my jupyter notebook in a conda envirnoment I have called tensorflow. Here is the .yml file I build it from:
It ran perfectly fine a few days ago, I took a break and tried to run the exact same code today, and I got that error above! I changed nothing, and it was very very confusing. I just restarted my computer and suddenly the issue is gone. Does anyone have an explaination? I'm not sure how to recreate it, but here is what I had
Edit: I was reading and tried the reduce_prod import which wasn't working and forgot it was in my list of imports. Commenting it out still runs without that error. |
After edit the
I use :
|
@yangleir Update your numpy version to the last one. |
For cpu version, I found |
Jax reports errors, type mismatch Numpy issue may be able to be resolve here: tensorflow/models#9706 modified: astronet/metrics.py
Is this change proposed by @athenasaurav expected to be released anytime soon? Modifying a file from the package after installing does not seem like a good solution to me. Neither does downgrading numpy, especially if the rest of my code uses features only available in numpy 1.20. |
Suddenly experiencing this problem in google colab with object detection API and TF1 with code that worked perfectly fine last week 🤔 |
from tensorflow.python.ops.math_ops import reduce_prod the above import package working fine. Locations : -\Lib\site-packages\tensorflow_core\python\ops\array_ops.py |
[Solved]I have the same error when training the data, even also try to downgrade the NumPy version, but it not be fixed.
|
this worked for me too. |
I had the same problem when using colab, fixed it by reinstalling numpy==1.19.0 |
This worked for me: OS: Windows 10 call python -m pip install tensorflow==2.4.1 --force-reinstall |
simply change the tensorflow or tensorflow-gpu to older versions: |
This works fine for me: OS: MacOS Monterey tensorflow: 2.11.0 This was the the versions the packages on Google Colab where things are working |
downgrade the numpy worked for me |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
1. The entire URL of the file you are using
https://github.com/tensorflow/models/blob/master/research/object_detection/model_main_tf2.py
2. Describe the bug
I am trying to train object detection model for custom data using tutorial on link. I tested the for environment faults using https://github.com/tensorflow/models/blob/master/research/object_detection/builders/model_builder_tf2_test.py. All test passed. But when I put it for training the models gives out error.
Logs:
6. System information
The text was updated successfully, but these errors were encountered: