HRNet / HRNet-Semantic-Segmentation

The OCR approach is rephrased as Segmentation Transformer: https://arxiv.org/abs/1909.11065. This is an official implementation of semantic segmentation for HRNet. https://arxiv.org/abs/1908.07919

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cv2.error: OpenCV(4.5.3) /tmp/pip-req-build-f51eratu/opencv/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

lkp520 opened this issue · comments

When I use lip datasets to val, as I run python tools/test.py --cfg experiments/lip/seg_hrnet_w48_473x473_sgd_lr7e-3_wd5e-4_bs_40_epoch150.yaml DATASET.TEST_SET list/lip/testvalList.txt TEST.MODEL_FILE hrnet_w48_lip_cls20_473x473.pth TEST.FLIP_TEST True TEST.NUM_SAMPLES 0 , I meet the problem below:

Traceback (most recent call last):
File "tools/test.py", line 143, in
main()
File "tools/test.py", line 120, in main
mean_IoU, IoU_array, pixel_acc, mean_acc = testval(config,
File "/data/likengpeng/HRNet-Semantic-Segmentation/tools/../lib/core/function.py", line 159, in testval
for index, batch in enumerate(tqdm(testloader)):
File "/home/amax/anaconda3/lib/python3.8/site-packages/tqdm/std.py", line 1165, in iter
for obj in iterable:
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 435, in next
data = self._next_data()
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
cv2.error: Caught error in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/data/likengpeng/HRNet-Semantic-Segmentation/tools/../lib/datasets/lip.py", line 91, in getitem
image = cv2.resize(image, self.crop_size,
cv2.error: OpenCV(4.5.3) /tmp/pip-req-build-f51eratu/opencv/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/amax/anaconda3/lib/python3.8/multiprocessing/popen_fork.py", line 27, in poll
pid, sts = os.waitpid(self.pid, flag)
File "/home/amax/anaconda3/lib/python3.8/site-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler
_error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 16163) is killed by signal: Terminated.

How can I solve it? Thank you!

I have solved it. Just put the val_images and val_segmentations into /data/