for filename in os.listdir(TEST_IMAGE_DIR):
image_path = os.path.join(TEST_IMAGE_DIR, filename)
start = time.time()
image_data = cv2.imread(image_path)
img_RGB = image_data[..., [2, 1, 0]]
image_data = cv2.resize(img_RGB, (w, h))
image_np = np.array(image_data).astype(np.uint8)
image_np_expanded = np.expand_dims(image_np, axis=0)
(boxes, scores, classes,num_detections) = sess.run([boxes, scores, classes, num_detections], feed_dict={detect_image_tensor: image_np_expanded})
The error is as follows:
TypeError: Fetch argument array has invalid type <type’numpy.ndarry ‘ >, must be a string or Tensor. (Can not convert an int into a Tensor or Operation.)
the reason:
Variable name has the same name
Solution:
####Change Variable name
(detection_boxes, detection_scores, detection_classes, detection_num_detections) = sess.run([boxes, scores, classes, num_detections], feed_dict={detect_image_tensor: image_np_expanded})
Similar Posts:
- Tensorflowcenter {typeerror} non hashable type: “numpy. Ndarray”
- PaddlePaddle Error: ‘map’ object is not subscriptable
- Preservation and recovery of TF. Train. Saver () model of tensorflow
- Tensorflow error due to uninitialized variable [How to Fix]
- How to optimize for inference a simple, saved TensorFlow 1.0.1 graph?
- Tensorflow gradients TypeError: Fetch argument None has invalid type
- InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor ‘…
- Chinese character handwriting recognition based on densenetensorflow
- [Solved] PyTorch error: TypeError: ‘builtin_function_or_method‘ object is unsubscriptable
- javax.imageio.IIOException: Can’t read input file! 23436;”209151;