PRM icon indicating copy to clipboard operation
PRM copied to clipboard

ran out of input

Open GrassBro opened this issue 6 years ago • 12 comments


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 avatar Feb 25 '19 09:02 GrassBro

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

GrassBro avatar Feb 25 '19 09:02 GrassBro

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 avatar Feb 26 '19 03:02 GrassBro

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.

GrassBro avatar Feb 27 '19 12:02 GrassBro

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.

shamyW avatar Mar 01 '19 08:03 shamyW

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.

GrassBro avatar Mar 01 '19 11:03 GrassBro

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!

shamyW avatar Mar 03 '19 09:03 shamyW

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.

GrassBro avatar Mar 03 '19 09:03 GrassBro

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!

shamyW avatar Mar 03 '19 09:03 shamyW

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.

GrassBro avatar Mar 03 '19 10:03 GrassBro

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 avatar Mar 04 '19 02:03 shamyW

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 avatar Mar 11 '19 08:03 shamyW

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!

shamyW avatar Mar 13 '19 06:03 shamyW