Topaz Train error: invalid literal for int() with base 10

Hi,

I tried to run topaz train job as described in the tutorial, but got this error. My topaz is on sbgrid.

Thanks!

Hi @Feng10,

Could you post all the output logs from the failed Topaz job?

Thanks,
Jay Yoo

Hi @jyoo,

This is the log for failed Topaz train. Please let me know if you need other things.

Many thanks!

Hi @Feng10,

This seems to be a problem specific to Topaz on sbgrid. For now try using Topaz through Anaconda. Steps on how to install Topaz through Anaconda can be found here https://github.com/tbepler/topaz.

Please let me know if Topaz must be run on sbgrid instead of Anaconda. If so, I’ll look into the problem further.

Regards,
Jay Yoo

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 .

if val.isdigit():

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”.