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

fine tuning时报错,是训练集的图片尺寸问题吗? #7

Open
hai4john opened this issue Apr 10, 2024 · 0 comments
Open

fine tuning时报错,是训练集的图片尺寸问题吗? #7

hai4john opened this issue Apr 10, 2024 · 0 comments

Comments

@hai4john
Copy link

fine tuning时,报如下错误,是对训练集的图片尺寸有要求吗?
24-04-10 10:36:36.398 - INFO: Learning rate: 0.0001
Traceback (most recent call last):
File "/home/zhanghh/work/JiangWeibeta/MLIC/MLIC++/playground/train.py", line 162, in
main()
File "/home/zhanghh/work/JiangWeibeta/MLIC/MLIC++/playground/train.py", line 124, in main
current_step = train_one_epoch(
File "/home/zhanghh/work/JiangWeibeta/MLIC/MLIC++/utils/training.py", line 24, in train_one_epoch
optimizer.step()
File "/home/zhanghh/work/JiangWeibeta/MLIC/venv/lib/python3.10/site-packages/torch/optim/lr_scheduler.py", line 75, in wrapper
return wrapped(*args, **kwargs)
File "/home/zhanghh/work/JiangWeibeta/MLIC/venv/lib/python3.10/site-packages/torch/optim/optimizer.py", line 385, in wrapper
out = func(*args, **kwargs)
File "/home/zhanghh/work/JiangWeibeta/MLIC/venv/lib/python3.10/site-packages/torch/optim/optimizer.py", line 76, in _use_grad
ret = func(self, *args, **kwargs)
File "/home/zhanghh/work/JiangWeibeta/MLIC/venv/lib/python3.10/site-packages/torch/optim/adam.py", line 166, in step
adam(
File "/home/zhanghh/work/JiangWeibeta/MLIC/venv/lib/python3.10/site-packages/torch/optim/adam.py", line 316, in adam
func(params,
File "/home/zhanghh/work/JiangWeibeta/MLIC/venv/lib/python3.10/site-packages/torch/optim/adam.py", line 520, in _multi_tensor_adam
torch.foreach_lerp(device_exp_avgs, device_grads, 1 - beta1)
RuntimeError: The size of tensor a (32) must match the size of tensor b (192) at non-singleton dimension 0

有看到 dataload部分
train_transforms = transforms.Compose(
[transforms.RandomCrop(args.patch_size), transforms.ToTensor()]
)
对图像进行裁剪,理论上只要数据集中图片尺寸大于 args.patch_size 就行,对吧?

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