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

how to run resnet50 and how to set dataset to cifar10 #4

Open
martin0310 opened this issue Dec 17, 2023 · 0 comments
Open

how to run resnet50 and how to set dataset to cifar10 #4

martin0310 opened this issue Dec 17, 2023 · 0 comments

Comments

@martin0310
Copy link

Run resnet50:

when i run the command:
python imagenet.py --gpus 0 --arch resnet50 --job_dir ./experiment --data_path image_dir --pretrained_model pretrained_model/resnet50.pth --pr_target 0.5 --N 4 --conv_type BlockL1Conv --train_batch_size 256 --eval_batch_size 256 --rearrange --num_epochs 2 --export_onnx

the output in terminal shows:
==> Preparing data..
==> Conv Type: BlockL1Conv
==> BN Type: LearnedBatchNorm
Traceback (most recent call last):
/1xN/imagenet.py", line 455, in
main()
/1xN/imagenet.py", line 292, in main
model, pr_cfg = get_model(args)
^^^^^^^^^^^^^^^
/1xN/imagenet.py", line 238, in get_model
ckpt = torch.load(args.pretrained_model, map_location=device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/anaconda3/envs/new_torch/lib/python3.11/site-packages/torch/serialization.py", line 1028, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/anaconda3/envs/new_torch/lib/python3.11/site-packages/torch/serialization.py", line 1231, in legacy_load
return legacy_load(f)
^^^^^^^^^^^^^^
/anaconda3/envs/new_torch/lib/python3.11/site-packages/torch/serialization.py", line 1158, in legacy_load
tensor = torch.tensor([], dtype=storage.dtype).set
(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Attempted to set the storage of a tensor on device "cpu" to a storage on different device "cuda:0". This is no longer allowed; the devices must match.

set data to cifar10:

Is there any complete example command for setting dataset to cifar10?
image

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

1 participant