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

Can't start training? #71

Open
foreversolar opened this issue Aug 7, 2021 · 1 comment
Open

Can't start training? #71

foreversolar opened this issue Aug 7, 2021 · 1 comment

Comments

@foreversolar
Copy link

foreversolar commented Aug 7, 2021

After following the instructions to download and convert the data, I run the program as

export EXPNAME=baseline_imagenet
for BACKBONE in resnet mamlconvnet mamlresnet
do
  export JOBNAME=${EXPNAME}_${BACKBONE}
  python -m meta_dataset.train \
    --records_root_dir=./converted_data \
    --train_checkpoint_dir=./output/checkpoints/${JOBNAME} \
    --summary_dir=./output/summaries/${JOBNAME} \
    --gin_config=meta_dataset/learn/gin/best/${JOBNAME}.gin \
    --gin_bindings="Trainer.experiment_name='$EXPNAME'"
done

but then the error says

I0807 18:17:11.320141 140426680824000 resource_reader.py:50] system_path_file_exists:meta_dataset/learn/gin/best/baseline_imagenet_mamlresnet.gin
Traceback (most recent call last):
  File "/home/****/anaconda3/envs/tf/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/****/anaconda3/envs/tf/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/****/meta_malware/meta-dataset/meta_dataset/train.py", line 273, in <module>
    app.run(program)
  File "/home/****/anaconda3/envs/tf/lib/python3.7/site-packages/absl/app.py", line 303, in run
    _run_main(main, args)
  File "/home/****/anaconda3/envs/tf/lib/python3.7/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "/home/****/meta_malware/meta-dataset/meta_dataset/train.py", line 182, in main
    parse_cmdline_gin_configurations()
  File "/home/****/meta_malware/meta-dataset/meta_dataset/train.py", line 151, in parse_cmdline_gin_configurations
    FLAGS.gin_config, FLAGS.gin_bindings, finalize_config=True)
  File "/home/****/anaconda3/envs/tf/lib/python3.7/site-packages/gin/config.py", line 1810, in parse_config_files_and_bindings
    includes_and_imports = parse_config_file(config_file, skip_unknown)
  File "/home/****/anaconda3/envs/tf/lib/python3.7/site-packages/gin/config.py", line 1762, in parse_config_file
    if existence_check(config_file_with_prefix):
  File "/home/****/anaconda3/envs/tf/lib/python3.7/site-packages/gin/resource_reader.py", line 52, in system_path_file_exists
    path = _parse_config_path(config_path)
  File "/home/****/anaconda3/envs/tf/lib/python3.7/site-packages/gin/resource_reader.py", line 89, in _parse_config_path
    path = os.path.join(os.path.dirname(file_sys_path), filename)
  File "/home/****/anaconda3/envs/tf/lib/python3.7/posixpath.py", line 156, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
@foreversolar
Copy link
Author

foreversolar commented Aug 7, 2021

it seems that something wrong with the gin?

in the gin->resource_reader.py

def _parse_config_path(config_path: str) -> str:
  head, filename = os.path.split(config_path)
  pkg = head.replace('/', '.')
  spec = importlib.util.find_spec(pkg)                                  #  this line return a spec with None origin ! !
  if spec is None:
    raise ValueError('Package not found', pkg)
  file_sys_path = spec.origin
  # file_sys_path often ends with __init__.py.
  path = os.path.join(os.path.dirname(file_sys_path), filename)    # input None here cause the error 
  return path

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

No branches or pull requests

1 participant