u-2-net-portrait icon indicating copy to clipboard operation
u-2-net-portrait copied to clipboard

training

Open ucb-pb opened this issue 3 years ago • 3 comments

Thank you for sharing your work! I'm trying to figure out how to start training, but am not very familiar with hydra and am running into errors with it. I modified conf/dataset.yaml, but also changed it back to what it was originally and it still gives the same error. Perhaps you might have an idea what the problem is?

File "train.py", line 279, in <module>
   main()
 File "/usr/local/lib/python3.8/dist-packages/hydra/main.py", line 49, in decorated_main
   _run_hydra(
 File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/utils.py", line 367, in _run_hydra
   run_and_report(
 File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/utils.py", line 214, in run_and_report
   raise ex
 File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/utils.py", line 211, in run_and_report
   return func()
 File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/utils.py", line 368, in <lambda>
   lambda: hydra.run(
 File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/hydra.py", line 110, in run
   _ = ret.return_value
 File "/usr/local/lib/python3.8/dist-packages/hydra/core/utils.py", line 233, in return_value
   raise self._return_value
 File "/usr/local/lib/python3.8/dist-packages/hydra/core/utils.py", line 160, in run_job
   ret.return_value = task_function(task_cfg)
 File "train.py", line 73, in main
   train_collate_fn = dataset.get_collate_fn(mode='train', channels_last=cfg.trainer.channels_last)
 File ".../u-2-net-portrait/lib/data/dataset.py", line 74, in get_collate_fn
   transforms[configuration.identifier] = [instantiate(step) for step in steps]
 File ".../u-2-net-portrait/lib/data/dataset.py", line 74, in <listcomp>
   transforms[configuration.identifier] = [instantiate(step) for step in steps]
 File "/usr/local/lib/python3.8/dist-packages/hydra/_internal/instantiate/_instantiate2.py", line 182, in instantiate
   raise InstantiationException(
hydra.errors.InstantiationException: Top level config has to be OmegaConf DictConfig, plain dict, or a Structured Config class or instance

As a side note, a requirements.txt file would be useful to include in this repo

ucb-pb avatar Jun 29 '21 21:06 ucb-pb

@ucb-pb have you solve the problem?i have theproblem

Testhjf avatar Jan 06 '22 10:01 Testhjf

I solved this problem. Remove hydra and hydra-core and reinstall hydra-core by typing pip install hydra-core==1.1.0.dev3

gyupro avatar Jan 19 '22 04:01 gyupro

There is an environment.yaml file in the repository to be used with conda as alternative for a requirements.txt

dbpprt avatar Feb 01 '22 23:02 dbpprt