ZhouYanzhao / PRM

Weakly Supervised Instance Segmentation using Class Peak Response, in CVPR 2018 (Spotlight)
346 stars 60 forks source link

ran out of input #21

Open GrassBro opened 5 years ago

GrassBro commented 5 years ago

EOFError Traceback (most recent call last)

in ----> 1 run_tasks('./config.yml') ~/.conda/envs/prm/lib/python3.6/site-packages/nest/parser.py in run_tasks(config_file, param_file, verbose) 135 logger.info('Finished (%s).' % (U.format_elapse(seconds=(end_time - param_start_time).total_seconds()))) 136 else: --> 137 resolved_config = parse_config(config, env_vars=env_vars) 138 check_all_resolved(resolved_config) 139 ~/.conda/envs/prm/lib/python3.6/site-packages/nest/parser.py in parse_config(config, env_vars, global_vars) 58 elif isinstance(val, dict): 59 config[key] = parse_config( ---> 60 val, env_vars=env_vars, global_vars=global_vars) 61 if key == '_var': 62 U.merge_dict(global_vars, config[key], union=True) ~/.conda/envs/prm/lib/python3.6/site-packages/nest/parser.py in parse_config(config, env_vars, global_vars) 58 elif isinstance(val, dict): 59 config[key] = parse_config( ---> 60 val, env_vars=env_vars, global_vars=global_vars) 61 if key == '_var': 62 U.merge_dict(global_vars, config[key], union=True) ~/.conda/envs/prm/lib/python3.6/site-packages/nest/parser.py in parse_config(config, env_vars, global_vars) 68 return nest_module(**config) 69 else: ---> 70 return nest_module(**config, delay_resolve=True) 71 72 return config ~/.conda/envs/prm/lib/python3.6/site-packages/nest/modules.py in __call__(self, *args, **kwargs) 160 try: 161 self._check_params(resolved_params) --> 162 returns = self.func(**resolved_params) 163 except KeyError as exc_info: 164 if 'Nest module' in str(exc_info): ~/PRM-pytorch/install/prm.py in fc_resnet50(num_classes, pretrained) 17 """FC ResNet50. 18 """ ---> 19 model = FC_ResNet(models.resnet50(pretrained), num_classes) 20 return model 21 ~/.conda/envs/prm/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg/torchvision/models/resnet.py in resnet50(pretrained, **kwargs) 186 model = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs) 187 if pretrained: --> 188 model.load_state_dict(model_zoo.load_url(model_urls['resnet50'])) 189 return model 190 ~/.conda/envs/prm/lib/python3.6/site-packages/torch/utils/model_zoo.py in load_url(url, model_dir, map_location, progress) 64 hash_prefix = HASH_REGEX.search(filename).group(1) 65 _download_url_to_file(url, cached_file, hash_prefix, progress=progress) ---> 66 return torch.load(cached_file, map_location=map_location) 67 68 ~/.conda/envs/prm/lib/python3.6/site-packages/torch/serialization.py in load(f, map_location, pickle_module) 301 f = open(f, 'rb') 302 try: --> 303 return _load(f, map_location, pickle_module) 304 finally: 305 if new_fd: ~/.conda/envs/prm/lib/python3.6/site-packages/torch/serialization.py in _load(f, map_location, pickle_module) 457 f.seek(0) 458 --> 459 magic_number = pickle_module.load(f) 460 if magic_number != MAGIC_NUMBER: 461 raise RuntimeError("Invalid magic number; corrupt file?") EOFError: Ran out of input
GrassBro commented 5 years ago

Hi, Yanzhao, this error is related to 'run_tasks('./config.yml')', do you have any suggestions about this error? @ZhouYanzhao

GrassBro commented 5 years ago

Hi, @ZhouYanzhao ,

59 config[key] = parse_config( ---> 60 val, env_vars=env_vars, global_vars=global_vars)

It seems that the error happens at line 60 in parser.py file of the nest package. However, I can not figure out the reason as I am not familiar with the iteration operation in this file.

looking forward to your suggestions.

Thanks, Xin

GrassBro commented 5 years ago

I fixed the bug by changing the python and pytorch version. While the basic problem is that the code can find the file path but cannot load the file. Sorry for bothering. This issue could be closed.

shamyW commented 5 years ago

I also got an error related to 'run_tasks('./config.yml')'. I have set all the Prerequisites same with the 'ReadMe.md' except the system. I run this code on Ubuntu 16.04, could you please tell me what is your system?

Looking forward for your answer. Thanks a lot.

GrassBro commented 5 years ago

I also got an error related to 'run_tasks('./config.yml')'. I have set all the Prerequisites same with the 'ReadMe.md' except the system. I run this code on Ubuntu 16.04, could you please tell me what is your system?

Looking forward for your answer. Thanks a lot.

I have the same operating system as you. Anyway, you can download the resnet50 model into the target folder, then the code can load that model and no errors happened. I didn't change any code for simplification.

shamyW commented 5 years ago

I haven't solve this error although I download the resnet50 model. I guess I may set the wrong path.Could you tell me how you set your folder(like dataset, 'resnet50.pth', etc)? Thanks again!

GrassBro commented 5 years ago

I haven't solve this error although I download the resnet50 model. I guess I may set the wrong path.Could you tell me how you set your folder(like dataset, 'resnet50.pth', etc)? Thanks again!

/usr/local/lib/python3.*/dist-packages/torchvision/models/resnet50....pth This is useful for me.

shamyW commented 5 years ago

I haven't solve this error although I download the resnet50 model. I guess I may set the wrong path.Could you tell me how you set your folder(like dataset, 'resnet50.pth', etc)? Thanks again!

/usr/local/lib/python3.*/dist-packages/torchvision/models/resnet50....pth This is useful for me.

THANK YOU SOOOOO MUCH! I will try it!

GrassBro commented 5 years ago

I haven't solve this error although I download the resnet50 model. I guess I may set the wrong path.Could you tell me how you set your folder(like dataset, 'resnet50.pth', etc)? Thanks again!

/usr/local/lib/python3.*/dist-packages/torchvision/models/resnet50....pth This is useful for me.

THANK YOU SOOOOO MUCH! I will try it!

WELCOME.

shamyW commented 5 years ago

I haven't solve this error although I download the resnet50 model. I guess I may set the wrong path.Could you tell me how you set your folder(like dataset, 'resnet50.pth', etc)? Thanks again!

/usr/local/lib/python3.*/dist-packages/torchvision/models/resnet50....pth This is useful for me.

THANK YOU SOOOOO MUCH! I will try it!

WELCOME.

It works! Thanks again! :D

shamyW commented 5 years ago

Hello~Me again! I run this demo, but it seems that the result is much poor(I test the categeries label with VOC2007test(images 4000+) and it shows that the accuracy is 2%). I am wondering if you can reproduction the code and get the similar result with the author?

Looking for your reply! Thank you so much!

shamyW commented 5 years ago

Hello~Me again! I run this demo, but it seems that the result is much poor(I test the categeries label with VOC2007test(images 4000+) and it shows that the accuracy is 2%). I am wondering if you can reproduction the code and get the similar result with the author?

Looking for your reply! Thank you so much!

I find the bad result is caused by my own error in the code! Now I solve this problem. Thanks!