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

hydra.errors.InstantiationException: Error locating target 'fhmap.factory.dataset.Cifar10DataModule' #17

Open
qm-intel opened this issue Dec 27, 2023 · 1 comment

Comments

@qm-intel
Copy link

@gatheluck

Thanks for your contribution

I have downloaded the resnet56 weights from this link., and the weight has been saved in the following folder:

FourierHeatmap
├── weights
│	└── resnet56-4bfd9763.th

CIFAR10 data is in the following folder

FourierHeatmap
├── data
│	└── cifar10
│		├── train/
│		└── val/

When I am trying to run the code,

poetry run python fhmap/apps/eval_fhmap.py dataset=cifar10 arch=resnet56 weightpath=weights/resnet56-4bfd9763.th eps=4.0

I am getting this error:


hydra.errors.InstantiationException: Error locating target 'fhmap.factory.dataset.Cifar10DataModule', set env var HYDRA_FULL_ERROR=1 to see chained exception.
full_key: dataset

which is related to this line of code

How this can be resolved? Am I making mistakes somewhere in the command?

and this is the full output:

poetry run python fhmap/apps/eval_fhmap.py dataset=cifar10 arch=resnet56 weightpath=weights/resnet56-4bfd9763.th eps=4.0
/home/user/PycharmProjects/FrequencyAnalysis/FourierHeatmap/fhmap/apps/eval_fhmap.py:72: UserWarning: 
The version_base parameter is not specified.
Please specify a compatability version level, or None.
Will assume defaults for version 1.1
  @hydra.main(config_path="../config", config_name="eval_fhmap")
Wed Dec 27 13:24:56 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.05             Driver Version: 535.104.05   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA RTX 6000 Ada Gene...    On  | 00000000:41:00.0  On |                    0 |
| 30%   38C    P8              23W / 300W |  18816MiB / 46068MiB |      8%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
|   1  NVIDIA RTX 6000 Ada Gene...    On  | 00000000:61:00.0 Off |                    0 |
| 30%   36C    P8              27W / 300W |     25MiB / 46068MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      1964      G   /usr/lib/xorg/Xorg                           39MiB |
|    0   N/A  N/A      2827      G   /usr/lib/xorg/Xorg                          193MiB |
|    0   N/A  N/A      2958      G   /usr/bin/gnome-shell                         40MiB |
|    0   N/A  N/A      4985      G   ...seed-version=20231214-180149.265000      105MiB |
|    0   N/A  N/A     13682      C   .../anaconda3/envs/text2seg/bin/python     8260MiB |
|    0   N/A  N/A     69924      C   .../anaconda3/envs/text2seg/bin/python    10068MiB |
|    0   N/A  N/A     72210      G   .../anaconda3/envs/text2seg/bin/python       31MiB |
|    0   N/A  N/A    167619      G   ...ures=SpareRendererForSitePerProcess       24MiB |
|    1   N/A  N/A      1964      G   /usr/lib/xorg/Xorg                            4MiB |
|    1   N/A  N/A      2827      G   /usr/lib/xorg/Xorg                            4MiB |
+---------------------------------------------------------------------------------------+
INFO:__main__:0
/home/user/anaconda3/envs/freq-env/lib/python3.9/site-packages/hydra/_internal/defaults_list.py:251: UserWarning: In 'eval_fhmap': Defaults list is missing `_self_`. See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/default_composition_order for more information
  warnings.warn(msg, UserWarning)
sys:1: UserWarning: 
'eval_fhmap' is validated against ConfigStore schema with the same name.
This behavior is deprecated in Hydra 1.1 and will be removed in Hydra 1.2.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/automatic_schema_matching for migration instructions.
/home/user/anaconda3/envs/freq-env/lib/python3.9/site-packages/hydra/main.py:94: UserWarning: 
'eval_fhmap' is validated against ConfigStore schema with the same name.
This behavior is deprecated in Hydra 1.1 and will be removed in Hydra 1.2.
See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/automatic_schema_matching for migration instructions.
  _run_hydra(
/home/user/anaconda3/envs/freq-env/lib/python3.9/site-packages/hydra/_internal/hydra.py:119: UserWarning: Future Hydra versions will no longer change working directory at job runtime by default.
See https://hydra.cc/docs/1.2/upgrades/1.1_to_1.2/changes_to_job_working_dir/ for more information.
  ret = run_job(
[2023-12-27 13:24:56,781][__main__][INFO] - arch:
  _target_: fhmap.factory.archs.resnet.resnet56
  pretrained: false
dataset:
  _target_: fhmap.factory.dataset.Cifar10DataModule
env:
  device: cuda:0
  num_nodes: 1
  num_workers: 8
  savedir: outputs
batch_size: 512
eps: 4.0
ignore_edge_size: 0
num_samples: -1
topk:
- 1
- 5
weightpath: weights/resnet56-4bfd9763.th

Error executing job with overrides: ['dataset=cifar10', 'arch=resnet56', 'weightpath=weights/resnet56-4bfd9763.th', 'eps=4.0']
Error locating target 'fhmap.factory.dataset.Cifar10DataModule', set env var HYDRA_FULL_ERROR=1 to see chained exception.
full_key: dataset

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
@qiqiiii
Copy link

qiqiiii commented Jul 23, 2024

I had the same problem as you. How did you solve it?

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

No branches or pull requests

2 participants