-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: invalid literal for int() with base 10: '' #14
Comments
@sameer56 please check your configuration file, the |
Hi, |
@sameer56 As described here in the README, parameters are specified by providing a configuration file to the training scripts. The files in |
The error message invalid literal for int() with base 10 would seem to indicate that you are passing a string that's not an integer to the int() function . In other words it's either empty, or has a character in it other than a digit. You can solve this error by using Python isdigit() method to check whether the value is number or not. The returns True if all the characters are digits, otherwise False .
The other way to overcome this issue is to wrap your code inside a Python try...except block to handle this error. Python2.x and Python3.x Sometimes the difference between Python2.x and Python3.x that leads to this ValueError: invalid literal for int() with base 10 . With Python2.x , int(str(3/2)) gives you "1". With Python3.x , the same gives you ("1.5"): ValueError: invalid literal for int() with base 10: "1.5". |
All possible working solution added [Solved] ValueError: invalid literal for int() with base 10 |
Traceback (most recent call last):
File "test_panoptic.py", line 358, in
main(parser.parse_args())
File "test_panoptic.py", line 322, in main
Traceback (most recent call last):
File "test_panoptic.py", line 358, in
test_dataloader = make_dataloader(args, config, rank, world_size)
File "test_panoptic.py", line 80, in make_dataloader
test_sampler = DistributedARBatchSampler(test_db, config.getint("val_batch_size"), world_size, rank, False)
File "/usr/lib/python3.6/configparser.py", line 1283, in get
main(parser.parse_args())
File "test_panoptic.py", line 322, in main
test_dataloader = make_dataloader(args, config, rank, world_size)
File "test_panoptic.py", line 80, in make_dataloader
test_sampler = DistributedARBatchSampler(test_db, config.getint("val_batch_size"), world_size, rank, False)
File "/usr/lib/python3.6/configparser.py", line 1283, in get
fallback=fallback, **kwargs)
File "/usr/lib/python3.6/configparser.py", line 819, in getint
fallback=fallback, **kwargs)
File "/usr/lib/python3.6/configparser.py", line 819, in getint
fallback=fallback, **kwargs)
File "/usr/lib/python3.6/configparser.py", line 809, in _get_conv
fallback=fallback, **kwargs)
File "/usr/lib/python3.6/configparser.py", line 809, in _get_conv
**kwargs)
File "/usr/lib/python3.6/configparser.py", line 803, in _get
**kwargs)
File "/usr/lib/python3.6/configparser.py", line 803, in _get
return conv(self.get(section, option, **kwargs))
ValueError: invalid literal for int() with base 10: ''
return conv(self.get(section, option, **kwargs))
ValueError: invalid literal for int() with base 10: ''
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.6/dist-packages/torch/distributed/launch.py", line 246, in
main()
File "/usr/local/lib/python3.6/dist-packages/torch/distributed/launch.py", line 242, in main
cmd=cmd)
subprocess.CalledProcessError: Command '['/home/teai/Pramod/pramod_env/bin/python3', '-u', 'test_panoptic.py', '--local_rank=1', 'config=/home/teai/Pramod/Segmentation/seamseg/seamseg_r50_vistas/config.ini', 'model=/home/teai/Pramod/Segmentation/seamseg/seamseg_r50_vistas/seamseg_r50_vistas.tar', 'data=/home/teai/Pramod/Segmentation/seamseg/Input_dir/', 'out_dir=/home/teai/Pramod/Segmentation/seamseg/Output_dir']' returned non-zero exit status 1.
The text was updated successfully, but these errors were encountered: