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

如何解决下面这个错误 路径输出图片都是正常的? #378

Open
rebornone1 opened this issue Jul 3, 2024 · 1 comment
Open

Comments

@rebornone1
Copy link

E:\daima\DB-master>python eval.py experiments/seg_detector/totaltext_resnet18_deform_thre.yaml --resume E:/daima/DB-master/models/totaltext_resnet18 --polygon --box_thresh 0.6
./datasets/total_text/
[INFO] [2024-07-03 10:09:06,691] Resuming from E:/daima/DB-master/models/totaltext_resnet18
[INFO] [2024-07-03 10:09:06,767] Resumed from E:/daima/DB-master/models/totaltext_resnet18
0%| | 0/300 [00:00<?, ?it/s]
Traceback (most recent call last):
File "eval.py", line 193, in
File "D:\Anaconda3\envs\CRAFT\lib\site-packages\torch\utils\data_utils\worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "D:\Anaconda3\envs\CRAFT\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:\Anaconda3\envs\CRAFT\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\daima\DB-master\data\image_dataset.py", line 88, in getitem
main()
File "eval.py", line 79, in main
Eval(experiment, experiment_args, cmd=args, verbose=args['verbose']).eval(args['visualize'])
File "eval.py", line 172, in eval
for i, batch in tqdm(enumerate(data_loader), total=len(data_loader)):
File "D:\Anaconda3\envs\CRAFT\lib\site-packages\tqdm\std.py", line 1181, in iter
for obj in iterable:
File "D:\Anaconda3\envs\CRAFT\lib\site-packages\torch\utils\data\dataloader.py", line 517, in next
data = self._next_data()
File "D:\Anaconda3\envs\CRAFT\lib\site-packages\torch\utils\data\dataloader.py", line 1199, in _next_data
return self._process_data(data)
File "D:\Anaconda3\envs\CRAFT\lib\site-packages\torch\utils\data\dataloader.py", line 1225, in _process_data
data.reraise()
File "D:\Anaconda3\envs\CRAFT\lib\site-packages\torch_utils.py", line 429, in reraise
raise self.exc_type(msg)
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:\Anaconda3\envs\CRAFT\lib\site-packages\torch\utils\data_utils\worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "D:\Anaconda3\envs\CRAFT\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:\Anaconda3\envs\CRAFT\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\daima\DB-master\data\image_dataset.py", line 88, in getitem
img = cv2.imread(image_path, cv2.IMREAD_COLOR).astype('float32')
AttributeError: 'NoneType' object has no attribute 'astype'

@rebornone1
Copy link
Author

输出image_path可以正常输出

(CRAFT) E:\daima\DB-master>
(CRAFT) E:\daima\DB-master>python eval.py experiments/seg_detector/totaltext_resnet18_deform_thre.yaml --resume E:/daima/DB-master/models/totaltext_resnet18 --polygon --box_thresh 0.6
./datasets/total_text/
[INFO] [2024-07-03 10:25:45,448] Resuming from E:/daima/DB-master/models/totaltext_resnet18
[INFO] [2024-07-03 10:25:45,482] Resumed from E:/daima/DB-master/models/totaltext_resnet18
./datasets/total_text/test_images/img605.jpg
./datasets/total_text/test_images/img547.jpg
./datasets/total_text/test_images/img1550.jpg
./datasets/total_text/test_images/img995.jpg
./datasets/total_text/test_images/img4.jpg
./datasets/total_text/test_images/img537.jpg
./datasets/total_text/test_images/img96.jpg
./datasets/total_text/test_images/img1098.jpg
./datasets/total_text/test_images/img500.jpg
./datasets/total_text/test_images/img797.jpg
./datasets/total_text/test_images/img651.jpg
./datasets/total_text/test_images/img557.jpg
./datasets/total_text/test_images/img9.jpg
./datasets/total_text/test_images/img1540.jpg
./datasets/total_text/test_images/img564.jpg
./datasets/total_text/test_images/img592.jpg
0%| | 0/300 [00:00<?, ?it/s].
/datasets/total_text/test_images/img1539.jpg
./datasets/total_text/test_images/img900.jpg

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