ImageAI icon indicating copy to clipboard operation
ImageAI copied to clipboard

TypeError: Tensor is unhashable. Instead, use tensor.ref() as the key.

Open Thanossrs opened this issue 5 years ago • 2 comments
trafficstars

detections = detector.detectCustomObjectsFromImage(custom_objects=custom_objects, input_image=original, output_image_path='imgnew.png',input_type="array",output_type="array", minimum_percentage_probability=40) Traceback (most recent call last):

File "C:\Users\Thanossrs\anaconda3\lib\site-packages\imageai\Detection_init_.py", line 833, in detectCustomObjectsFromImage feed_dict={

File "C:\Users\Thanossrs\anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 726, in hash raise TypeError("Tensor is unhashable. "

TypeError: Tensor is unhashable. Instead, use tensor.ref() as the key.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in detections = detector.detectCustomObjectsFromImage(custom_objects=custom_objects, input_image=original, output_image_path='imgnew.png',input_type="array",output_type="array", minimum_percentage_probability=40)

File "C:\Users\Thanossrs\anaconda3\lib\site-packages\imageai\Detection_init_.py", line 918, in detectCustomObjectsFromImage raise ValueError(

ValueError: Ensure you specified correct input image, input type, output type and/or output image path

COULD SOMEONE HELP ME TO SOLVE THIS? THANK YOU

Thanossrs avatar Sep 29 '20 10:09 Thanossrs

I had this problem until i installed TF < 2.0 and python 3.6. It all just went away after that.

bobwassell avatar Oct 02 '20 16:10 bobwassell

have same problem, tf 2.4.0 which is official requirement. How to fix it?

andvikt avatar Jul 28 '21 09:07 andvikt