Wanglaoban3 / GCN-weld-defect-classification

Paper: Few-shot weld defect images classification using graph neural network
MIT License
1 stars 0 forks source link

error #1

Open niudunn opened 1 year ago

niudunn commented 1 year ago

ss304数据集跑出来是正常的,但是换了一个RIAWELC数据集就会报错,两个数据集像素都是1280*700,格式都是png,这是因为什么呢,错误信息是这样的:成功加载数据集 成功加载数据集 开始训练 [ WARN:0@3.096] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4765.png'): can't open/read file: check file path/integrity [ WARN:0@6.203] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4526.png'): can't open/read file: check file path/integrity [ WARN:0@7.730] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-2993.png'): can't open/read file: check file path/integrity [ WARN:0@4.650] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img4-802.png'): can't open/read file: check file path/integrity [ WARN:0@1.551] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img5-2328.png'): can't open/read file: check file path/integrity [ WARN:0@4.660] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img5-2517.png'): can't open/read file: check file path/integrity [ WARN:0@1.561] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4353.png'): can't open/read file: check file path/integrity [ WARN:0@3.105] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img1-519.png'): can't open/read file: check file path/integrity [ WARN:0@7.739] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img0-160.png'): can't open/read file: check file path/integrity [ WARN:0@6.213] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img0-1176.png'): can't open/read file: check file path/integrity Traceback (most recent call last): File "D:\PycharmProjects\pt\GCN-weld-defect-classification-main\train.py", line 34, in my_run.train_one_epoch() File "D:\PycharmProjects\pt\GCN-weld-defect-classification-main\utils\run.py", line 118, in train_oneepoch [ WARN:0@7.740] global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjecs/RIAWELC1/train/RRT-Img3-3106.png'): can't open/read file: check file path/integrity for x, label in self.dataloader['train_loader']: File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 634, in next data = self._next_data() File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 1346, in _next_data return self._process_data(data) File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 1372, in _process_data data.reraise() File "D:\Anaconda\envs\pt\lib\site-packages\torch_utils.py", line 644, in reraise raise exception TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\PycharmProjects\pt\gcn-weld-defect-classification-g-main\utils\Datasets.py", line 39, in getitem transformed_image = self.transform(image=img)['image'] File "C:\Users\dell\AppData\Roaming\Python\Python38\site-packages\albumentations\core\composition.py", line 190, in call self._check_args(**data) File "C:\Users\dell\AppData\Roaming\Python\Python38\site-packages\albumentations\core\composition.py", line 267, in _check_args raise TypeError("{} must be numpy array type".format(data_name)) TypeError: image must be numpy array type

Process finished with exit code 1

Wanglaoban3 commented 1 year ago

你的报错提示是读取文件出错,导致读取到的路径是一个空的文件,然后由数据增强对这个空文件处理引发了报错,请检查你的数据的路径是否准确

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月13日(星期一) 上午10:26 收件人: @.>; 抄送: @.***>; 主题: [Wanglaoban3/GCN-weld-defect-classification] error (Issue #1)

ss304数据集跑出来是正常的,但是换了一个RIAWELC数据集就会报错,两个数据集像素格式都是1280*700,格式都是png,这是因为什么呢,错误信息是这样的:成功加载数据集 成功加载数据集 开始训练 [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4765.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4526.png'): can't open/read file: check file path/integrity [ @.*** global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-2993.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img4-802.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img5-2328.png'): can't open/read file: check file path/integrity [ @.*** global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img5-2517.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4353.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img1-519.png'): can't open/read file: check file path/integrity [ @.*** global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img0-160.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img0-1176.png'): can't open/read file: check file path/integrity Traceback (most recent call last): File "D:\PycharmProjects\pt\GCN-weld-defect-classification-main\train.py", line 34, in my_run.train_one_epoch() File "D:\PycharmProjects\pt\GCN-weld-defect-classification-main\utils\run.py", line 118, in train_one_epoch [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjecs/RIAWELC1/train/RRT-Img3-3106.png'): can't open/read file: check file path/integrity for x, label in self.dataloader['train_loader']: File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 634, in next data = self._next_data() File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 1346, in _next_data return self._process_data(data) File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 1372, in _process_data data.reraise() File "D:\Anaconda\envs\pt\lib\site-packages\torch_utils.py", line 644, in reraise raise exception TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\PycharmProjects\pt\gcn-weld-defect-classification-g-main\utils\Datasets.py", line 39, in getitem transformed_image = self.transform(image=img)['image'] File "C:\Users\dell\AppData\Roaming\Python\Python38\site-packages\albumentations\core\composition.py", line 190, in call self._check_args(**data) File "C:\Users\dell\AppData\Roaming\Python\Python38\site-packages\albumentations\core\composition.py", line 267, in _check_args raise TypeError("{} must be numpy array type".format(data_name)) TypeError: image must be numpy array type

Process finished with exit code 1

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

niudunn commented 1 year ago

你的报错提示是读取文件出错,导致读取到的路径是一个空的文件,然后由数据增强对这个空文件处理引发了报错,请检查你的数据的路径是否准确 ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月13日(星期一) 上午10:26 收件人: @.>; 抄送: @.>; 主题: [Wanglaoban3/GCN-weld-defect-classification] error (Issue #1) ss304数据集跑出来是正常的,但是换了一个RIAWELC数据集就会报错,两个数据集像素格式都是1280700,格式都是png,这是因为什么呢,错误信息是这样的:成功加载数据集 成功加载数据集 开始训练 [ **@. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4765.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4526.png'): can't open/read file: check file path/integrity [ @.*** global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-2993.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img4-802.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img5-2328.png'): can't open/read file: check file path/integrity [ @.*** global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img5-2517.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img3-4353.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img1-519.png'): can't open/read file: check file path/integrity [ @.*** global loadsave.cpp:244 cv::findDecoder imread('D:/PycharmProjects/RIAWELC1/train/RRT-Img0-160.png'): can't open/read file: check file path/integrity [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjects/RIAWELC1/train/RRT-Img0-1176.png'): can't open/read file: check file path/integrity Traceback (most recent call last): File "D:\PycharmProjects\pt\GCN-weld-defect-classification-main\train.py", line 34, in my_run.train_one_epoch() File "D:\PycharmProjects\pt\GCN-weld-defect-classification-main\utils\run.py", line 118, in train_one_epoch [ @. global loadsave.cpp:244 cv::findDecoder imread_('D:/PycharmProjecs/RIAWELC1/train/RRT-Img3-3106.png'): can't open/read file: check file path/integrity for x, label in self.dataloader['train_loader']: File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 634, in next data = self._next_data() File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 1346, in _next_data return self._process_data(data) File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data\dataloader.py", line 1372, in _process_data data.reraise() File "D:\Anaconda\envs\pt\lib\site-packages\torch_utils.py", line 644, in reraise raise exception TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\Anaconda\envs\pt\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\PycharmProjects\pt\gcn-weld-defect-classification-g-main\utils\Datasets.py", line 39, in getitem transformed_image = self.transform(image=img)['image'] File "C:\Users\dell\AppData\Roaming\Python\Python38\site-packages\albumentations\core\composition.py", line 190, in call self._check_args(data) File "C:\Users\dell\AppData\Roaming\Python\Python38\site-packages\albumentations\core\composition.py", line 267, in _check_args raise TypeError("{} must be numpy array type".format(data_name)) TypeError: image must be numpy array type Process finished with exit code 1 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: **@.***>

我检查了文件路径是没问题的,所以一直不知道是哪里的问题,总是会出现这个错误,改回ss304数据集就没问题了

niudunn commented 1 year ago

正确的文件路径是如此示例D:\PycharmProjects\pt\RIAWELC1\train\0ND\RRT-Img3-4526.png,报错信息没有包含0ND文件夹,但ss304也是分了多个文件夹,可以正常运行

Wanglaoban3 commented 1 year ago

电脑里有“D:\PycharmProjects\pt\RIAWELC1\train\0ND\RRT-Img3-4526.png”这个路径吗?

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月13日(星期一) 上午10:43 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Wanglaoban3/GCN-weld-defect-classification] error (Issue #1)

正确的文件路径是如此示例D:\PycharmProjects\pt\RIAWELC1\train\0ND\RRT-Img3-4526.png,报错信息没有包含0ND文件夹,但ss304也是分了多个文件夹,可以正常运行

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

niudunn commented 1 year ago

电脑里有“D:\PycharmProjects\pt\RIAWELC1\train\0ND\RRT-Img3-4526.png”这个路径吗? ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月13日(星期一) 上午10:43 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Wanglaoban3/GCN-weld-defect-classification] error (Issue #1) 正确的文件路径是如此示例D:\PycharmProjects\pt\RIAWELC1\train\0ND\RRT-Img3-4526.png,报错信息没有包含0ND文件夹,但ss304也是分了多个文件夹,可以正常运行 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

是有的,这个路径是存在的

niudunn commented 1 year ago

电脑里有“D:\PycharmProjects\pt\RIAWELC1\train\0ND\RRT-Img3-4526.png”这个路径吗? ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年11月13日(星期一) 上午10:43 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Wanglaoban3/GCN-weld-defect-classification] error (Issue #1) 正确的文件路径是如此示例D:\PycharmProjects\pt\RIAWELC1\train\0ND\RRT-Img3-4526.png,报错信息没有包含0ND文件夹,但ss304也是分了多个文件夹,可以正常运行 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

感谢感谢,我已经改好了这个问题,是因为我的标签没有加上级目录