AttributeError: 'NoneType' object has no attribute 'shape' #2896
Unanswered
chompu159789
asked this question in
Q&A
Replies: 1 comment
-
The issue is the variable filename. It is getting assigned to "None". So, you need to check the line |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm a collage student. My project is to prepare images for deep learning. I use detectron2 to Register my Dataset, all others .json file and their paths works fine without an error except the one below (I save about 30 imgs per folder ILA1 - ILA4) . How can I fix those problem? Thank you in advance.
/content/drive/MyDrive/FishWeightEstimation/Tilapia_video/week2/Biofloc2/image_left_anno/ILA1/image_left_anno1_json.json
AttributeError Traceback (most recent call last)
in ()
1 #Check, Folder Name Only in "/..." (Line 2)
----> 2 dataset_dicts = get_fish_dicts(path + "/ILA1")
3 print(dataset_dicts)
4
5 #If you want to check all file copy, for d in dataset_dicts:
in get_fish_dicts(img_dir)
15
16 filename = os.path.join(img_dir, v["filename"])
---> 17 height, width = cv2.imread(filename).shape[:2]
18 #print(idx, filename, height, width)
19
AttributeError: 'NoneType' object has no attribute 'shape'
Beta Was this translation helpful? Give feedback.
All reactions