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

cv2.error #16

Open
Heathcliff-saku opened this issue Apr 17, 2020 · 1 comment
Open

cv2.error #16

Heathcliff-saku opened this issue Apr 17, 2020 · 1 comment

Comments

@Heathcliff-saku
Copy link

(base) C:\Users\茅场晶彦\PycharmProjects\age-estimation-pytorch-master>python train.py --data_dir C:\Users\茅场晶彦\PycharmProjects\age-estimation-pytorch-master\appa-real-release TRAIN.BATCH_SIZE 8 MODEL.ARCH resnet34
=> creating model 'resnet34'
0%| | 0/499 [00:00<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 244, in
main()
File "train.py", line 206, in main
train_loss, train_acc = train(train_loader, model, criterion, optimizer, epoch, device)
File "train.py", line 62, in train
for x, y in _tqdm:
File "D:\ANA\lib\site-packages\tqdm_tqdm.py", line 937, in iter
for obj in iterable:
File "D:\ANA\lib\site-packages\torch\utils\data\dataloader.py", line 346, in next
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "D:\ANA\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\ANA\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\茅场晶彦\PycharmProjects\age-estimation-pytorch-master\dataset.py", line 79, in getitem
img = cv2.resize(img, (self.img_size, self.img_size))
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

@yu4u
Copy link
Owner

yu4u commented Jul 4, 2020

The dataset might not be appropriately located to --data_dir path.

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