ValueError: empty body on If

Hi!

Using Guild AI version 0.6.6 inside a virtual environment, I receive the following error:

$ guild run main.py
You are about to run /mnt/volume1/Dropbox/X/Y/W/main.py
  DEBUG: yes
  TRAIN: yes
  batch_norm: yes
  cudanum: 0
  ...
  
Continue? (Y/n) Y
Traceback (most recent call last):
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 290, in <module>
    main()
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 57, in main
    _main()
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 84, in _main
    _try_module(arg1, rest_args)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 134, in _try_module
    _dispatch_module_exec(_flags_dest(args), module_info)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 215, in _dispatch_module_exec
    _exec_module_with_globals(module_info, flags, args)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 271, in _exec_module_with_globals
    _module_with_globals(module_info, globals)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 278, in _module_with_globals
    _gen_exec(module_info, exec_script)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 251, in _gen_exec
    exec_cb()
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/op_main.py", line 277, in exec_script
    python_util.exec_script(path, globals)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/python_util.py", line 353, in exec_script
    code = _compile_script(src, filename, _node_filter(globals))
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/python_util.py", line 384, in _compile_script
    dont_inherit=True)
ValueError: empty body on If

This should be fixed in the latest prerelease version. Could you give that a try?

pip install guildai --pre --upgrade

Edit: fixed command to include --upgrade option.

Hi,

the following command did not upgrade guildai.

$ pip install guildai --pre
Requirement already satisfied: guildai in /home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages (0.6.6)
...

By also adding the --upgrade argument, I managed to upgrade to 0.7.0.rc9. It works fine now.

Thanks!

1 Like

The lastest version is 0.7.0.rc11. It’s surprising that you got only rc9. This suggests we’re missing a release for your platform, but as far as I know rc11 is available for all platforms that rc9 supports so that’s strange.