zdaiot / Kaggle-Steel-Defect-Detection

My solution to the Severstal: Steel Defect Detection on Kaggle, which got the 96th place. (Top4%)
https://www.zdaiot.com/MachineLearning/%E5%AE%9E%E6%88%98/Kaggle%20Steel%20Defect%20Detection%20%E6%80%BB%E7%BB%93/
MIT License
32 stars 10 forks source link

AttributeError: 'float' object has no attribute 'split' #5

Open xlxxlup opened 1 month ago

xlxxlup commented 1 month ago

yolov5) D:\steel-de\Kaggle-Steel-Defect-Detection-master\Kaggle-Steel-Defect-Detection-master>python train_classify.py --model_name=unet_resnet34 --batch_size=48 --lr=0.0005 --epoch=1 Using model: unet_resnet34 0%| | 0/210 [00:55<?, ?it/s]

Traceback (most recent call last): File "train_classify.py", line 176, in train_val.train(train_loader, valid_loader) File "train_classify.py", line 78, in train for i, (images, labels) in enumerate(tbar): File "D:\Anaconda\Anaconda\envs\yolov5\lib\site-packages\tqdm\std.py", line 1181, in iter for obj in iterable: File "D:\Anaconda\Anaconda\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 630, in next data = self._next_data() File "D:\Anaconda\Anaconda\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 1345, in _next_data return self._process_data(data) File "D:\Anaconda\Anaconda\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 1371, in _process_data data.reraise() File "D:\Anaconda\Anaconda\envs\yolov5\lib\site-packages\torch_utils.py", line 694, in reraise raise exception AttributeError: Caught AttributeError in DataLoader worker process 0. Original Traceback (most recent call last): File "D:\Anaconda\Anaconda\envs\yolov5\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "D:\Anaconda\Anaconda\envs\yolov5\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\Anaconda\envs\yolov5\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\steel-de\Kaggle-Steel-Defect-Detection-master\Kaggle-Steel-Defect-Detection-master\datasets\steel_dataset.py", line 68, in getitem image_id, mask = make_mask(idx, self.df) File "D:\steel-de\Kaggle-Steel-Defect-Detection-master\Kaggle-Steel-Defect-Detection-master\utils\rle_parse.py", line 26, in make_mask label = label.split(" ") AttributeError: 'float' object has no attribute 'split' 请问下这是什么原因

xlxxlup commented 1 month ago

模型下载完之后 就不动了