Closed Yufengevan closed 3 years ago
Hi,
can you set evaluate=False
, remove metric='wioa'
and then tell me what happens?
Furthermore which network do you use and what is the shape of your input data?
Please also show me the code that includes the forward pass.
Best Karol
Thank you for your reply! The problem i mentioned befored have been solved, it may be caused by the model have more than one output, and changing the output of model to one the problem disappeared.
However, the new problem happened. The information are:
Traceback (most recent call last):
File "/home/cnu_nyfMyTest_gradCam.py", line 96, in
My model is a variation of resnet50, and the size of input images is (1,3,352,352). I have tried the measures you mentiond, it dosen't work and still make this error.
Hi again,
so you have a new error now? Please post a snippet of the code you are using so I can get a better insight on the problem.
Best Karol
First of all thanks for your code. I refer to your unet segmentation example, my setting is
but when I run the test.py , there Is an error issue come:
File "/home/cnu_nyf/anaconda3/envs/inf/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "/home/cnu_nyf/anaconda3/envs/inf/lib/python3.6/site-packages/medcam-0.1.6-py3.6.egg/medcam/medcam_inject.py", line 199, in forward self.test_run(batch, internal=True) File "/home/cnu_nyf/anaconda3/envs/inf/lib/python3.6/site-packages/medcam-0.1.6-py3.6.egg/medcam/medcam_inject.py", line 229, in testrun = self.medcam_dict['model_backend'].generate_attention_map(batch, None) File "/home/cnu_nyf/anaconda3/envs/inf/lib/python3.6/site-packages/medcam-0.1.6-py3.6.egg/medcam/backends/base.py", line 21, in generate_attention_map output = self.forward(batch) File "/home/cnu_nyf/anaconda3/envs/inf/lib/python3.6/site-packages/medcam-0.1.6-py3.6.egg/medcam/backends/grad_cam.py", line 109, in forward return super(GradCAM, self).forward(data) File "/home/cnu_nyf/anaconda3/envs/inf/lib/python3.6/site-packages/medcam-0.1.6-py3.6.egg/medcam/backends/base.py", line 32, in forward self._extract_metadata(batch, self.logits) File "/home/cnu_nyf/anaconda3/envs/inf/lib/python3.6/site-packages/medcam-0.1.6-py3.6.egg/medcam/backends/base.py", line 75, in _extract_metadata self.output_batch_size = output.shape[0] AttributeError: 'tuple' object has no attribute 'shape'
In self.output_batch_size = output.shape[0], the output comes from self.logits = self.model.model_forward(batch) I have no idea with what the kind of self.logist should be