Categories
Misc

Unicode error. No fix working.

Hi,

I was trying to get an image in my code using the cv2 library, and using tf to identify it. But I am getting this weird error:

SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated UXXXXXXXX escape

———————————————————————————————————————————————

I tried using r string, double backslash and front slash but nothing worked. What’s weirder is that I have used the same code in the same file above to get a file and it works. Here is the code:

gray=cv2.cvtColor(r’C:UsersshivaDocumentsAI_ML_Tensorflowtest.png’,cv2.COLOR_BGR2GRAY)

——————————————————————————————————————————————–

Help is highly appreciated. Thanks.

submitted by /u/StarLan7
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *