Lazy environment loading appears to construct the on-disk path incorrectly in two places, causing Visdom to look for:
<env_path>/<eid>/.json
instead of the file layout used elsewhere in the codebase:
<env_path>/<eid>.json
This can prevent environments that are not already loaded in memory from being loaded from disk correctly.
Affected code
The issue appears in these locations:
py/visdom/utils/server_utils.py in compare_envs
py/visdom/utils/server_utils.py in load_env
Current code uses:
p = os.path.join(env_path, eid.strip(), ".json")
which resolves to a directory-style path such as:
Why this looks incorrect
Other parts of the codebase consistently use flat JSON files named <env>.json:
os.path.join(env_path, "{0}.json".format(env_id))
- environment deletion also assumes:
os.path.join(self.env_path, "{0}.json".format(msg["eid"]))
- app startup scans
env_path for *.json files directly
So the lazy-load path shape seems inconsistent with how environments are actually stored.
Expected behavior
When a saved environment is not already loaded in memory, Visdom should attempt to load it from:
Actual behavior
Visdom appears to try loading from:
which does not match the storage format used elsewhere.
Suggested fix
Replace:
os.path.join(env_path, eid.strip(), ".json")
with something like:
os.path.join(env_path, "{}.json".format(eid.strip()))
in both compare_envs and load_env.
Lazy environment loading appears to construct the on-disk path incorrectly in two places, causing Visdom to look for:
<env_path>/<eid>/.jsoninstead of the file layout used elsewhere in the codebase:
<env_path>/<eid>.jsonThis can prevent environments that are not already loaded in memory from being loaded from disk correctly.
Affected code
The issue appears in these locations:
py/visdom/utils/server_utils.pyincompare_envspy/visdom/utils/server_utils.pyinload_envCurrent code uses:
which resolves to a directory-style path such as:
Why this looks incorrect
Other parts of the codebase consistently use flat JSON files named
<env>.json:serialize_envwrites to:env_pathfor*.jsonfiles directlySo the lazy-load path shape seems inconsistent with how environments are actually stored.
Expected behavior
When a saved environment is not already loaded in memory, Visdom should attempt to load it from:
Actual behavior
Visdom appears to try loading from:
which does not match the storage format used elsewhere.
Suggested fix
Replace:
with something like:
in both
compare_envsandload_env.