0

AttributeError: 'NoneType' object has no attribute 'astype' occurs in the file ../lib/fast_rcnn/test.py, line 35, in _get_image_blob

im_orig =im.astype(np.float32,copy=True)

There is AttributeError:‘NoneType’ object has no attribute 'astype'

Shikha Dubey
  • 41
  • 1
  • 6
  • Your variable `im` is of type None. You should probably check whether it is initialized prior to trying to use it. – Orsiris de Jong Jul 21 '21 at 09:22
  • Does this answer your question? [Why do I get AttributeError: 'NoneType' object has no attribute 'something'?](https://stackoverflow.com/questions/8949252/why-do-i-get-attributeerror-nonetype-object-has-no-attribute-something) – Ulrich Eckhardt Jan 05 '22 at 18:06

1 Answers1

0

Solution: check the image path and correct it or pass the absolute image path.

Example:

filepath = os.path.join('/media/user/dataset/Coco 2014/test2014/', item['file_name']) 
Daniyal
  • 11
  • 2
Shikha Dubey
  • 41
  • 1
  • 6