ValueError: empty body on If


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

$ guild run
You are about to run /mnt/volume1/Dropbox/X/Y/W/
  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/", line 290, in <module>
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/", line 57, in main
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/", line 84, in _main
    _try_module(arg1, rest_args)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/", 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/", 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/", 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/", line 278, in _module_with_globals
    _gen_exec(module_info, exec_script)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/", line 251, in _gen_exec
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/", line 277, in exec_script
    python_util.exec_script(path, globals)
  File "/home/USER/.virtualenvs/my_venv/lib/python3.7/site-packages/guild/", 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/", line 384, in _compile_script
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.


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.


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.