Open HienTran1997 opened 4 years ago
Ok I Just find the way to fix this predict.py on google colab Step1: Just choose the Tensorflow 1.x %tensorflow_version 1.x Step 2: Edit code on predict.py like that (because colab cannot use cv2.imshow) from matplotlib import pyplot as plt
predict = sess.run(predict, feed_dict={model.images_feed: img}) predict = cv2.cvtColor(predict, cv2.COLOR_RGB2BGR) max=np.max(predict) final=predict/max plt.title("Image") plt.imshow(final)
plt.imsave('./example/1.png', final)
- I'm running on predict.py on colab (because i don't have GPU), colab cannot run the cv2.imshow() so i change the code like that: plt.imshow('Image', predict)
cv2.waitKey(0)