Skip to content
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

how to use train.py?? #52

Open
21toanyone-pro opened this issue Mar 17, 2019 · 1 comment
Open

how to use train.py?? #52

21toanyone-pro opened this issue Mar 17, 2019 · 1 comment

Comments

@21toanyone-pro
Copy link

I use default tfrecode in your git.

and I execution train.py.

but error

File "C:\Users\Lim\AppData\Roaming\Python\Python37\site-packages\absl\flags_flag.py", line 181, in _parse
return self.parser.parse(argument)
File "C:\Users\Lim\AppData\Roaming\Python\Python37\site-packages\absl\flags_argument_parser.py", line 114, in parse
type(argument)))
TypeError: flag value must be a string, found "<class 'float'>"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\Users\Lim.vscode\extensions\ms-python.python-2019.2.5558\pythonFiles\ptvsd_launcher.py", line 45, in
main(ptvsdArgs)
File "c:\Users\Lim.vscode\extensions\ms-python.python-2019.2.5558\pythonFiles\lib\python\ptvsd_main_.py", line 357, in main
run()
File "c:\Users\Lim.vscode\extensions\ms-python.python-2019.2.5558\pythonFiles\lib\python\ptvsd_main_.py", line 257, in run_file
runpy.run_path(target, run_name='main')
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\Users\Lim\Desktop\ocr\python\train.py", line 35, in
common_flags.define()
File "c:\Users\Lim\Desktop\ocr\python\common_flags.py", line 77, in define
'momentum value for the momentum optimizer if used')
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\flags.py", line 58, in wrapper
return original_function(*args, **kwargs)
File "C:\Users\Lim\AppData\Roaming\Python\Python37\site-packages\absl\flags_defines.py", line 241, in DEFINE_string
DEFINE(parser, name, default, help, flag_values, serializer, **args)
File "C:\Users\Lim\AppData\Roaming\Python\Python37\site-packages\absl\flags_defines.py", line 81, in DEFINE
DEFINE_flag(_flag.Flag(parser, serializer, name, default, help, **args),
File "C:\Users\Lim\AppData\Roaming\Python\Python37\site-packages\absl\flags_flag.py", line 110, in init
self._set_default(default)
File "C:\Users\Lim\AppData\Roaming\Python\Python37\site-packages\absl\flags_flag.py", line 211, in _set_default
self.default = self._parse(value)
File "C:\Users\Lim\AppData\Roaming\Python\Python37\site-packages\absl\flags_flag.py", line 184, in _parse
'flag --%s=%s: %s' % (self.name, argument, e))
absl.flags._exceptions.IllegalFlagValueError: flag --momentum=0.9: flag value must be a string, found "<class 'float'>"

I use Windows10 and Ubuntu16.04

but Both errors

I use tensorflow 1.13 and CUDA 8.0, python 3.7

Perhaps Is there anything I need to do before running train.py?

@A-bone1
Copy link
Owner

A-bone1 commented Mar 17, 2019

you may solved this problem by changing one line in the common_flags.py:
from
flags.DEFINE_string('momentum', 0.9,
'momentum value for the momentum optimizer if used')
to
flags.DEFINE_float('momentum', 0.9,
'momentum value for the momentum optimizer if used')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants