fastai efficientdet fails on learn.validate() with AttributeError: 'NoneType' object has no attribute 'shape'
See original GitHub issue🐛 Bug
when trying to simply validate metrics for an efficientdet model with fastai
KeyError: 'image_id'
AttributeError: 'NoneType' object has no attribute 'shape'
it fails when trying to read the batch size automatically: in accumulate, find_bs
class AvgLoss(Metric):
"Average the losses taking into account potential different batch sizes"
def reset(self): self.total,self.count = 0.,0
def accumulate(self, learn):
bs = find_bs(learn.yb)
self.total += learn.to_detach(learn.loss.mean())*bs
self.count += bs
@property
def value(self): return self.total/self.count if self.count != 0 else None
@property
def name(self): return "loss"
To Reproduce Steps to reproduce the behavior:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
AttributeError: 'NoneType' object has no attribute 'shape'
My data is organised as: train:- containing folder for each class valid :- containing folder for each class test:- contains all test images ......
Read more >Evaluate kitti--AttributeError: 'NoneType' object has no ...
When I try to evaluate the kitti dataset as is said in the GETTING_STARTED.MD , some problems occured during the running step just...
Read more >NoneType' object has no attribute 'shape - Stack Overflow
I am trying to do my detection but dont know why this error is comming up dont know whats the issue with this...
Read more >Attributeerror: 'nonetype' object has no attribute 'shape'
The error thus is a result of trying to access the 'shape' of an image that does not exist in the first value...
Read more >AttributeError: 'NoneType' object has no attribute 'dtype'
When trying to start the Training, I get the following Error: AttributeError: 'NoneType' object has no attribute 'dtype'. You can find the code ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found that applying a following patch:
fixes the issue. Im not sure though how should we store that patch in icevision. Anny suggestions?
The problem is that the test dataset (fridge_ds) has only 1 element in the validation set. Therefore I cannot test which list corresponds to the actual batch size, as it is always 1. 😄 I will increase the size of validation set to say 3 and then test again.