hello
first of all, I admire your perfect idea. I have tried to get run this code, but I got troubled by training.
when tried to run training dataset , the code worked. but when epochs arrived to evaluation part it stopped and did not work.
the problem is to build configuration of test data. i have problem how to make directories of dataset and paths of them. please help me soon .
this is one of the error :
!python train.py
Parameters...
datapath : /content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset
savepath : ./out/trained/
mode : train
batch : 16
lr : 0.001
verbose : 1
momen : 0.9
decay : 0.0005
epoch : 1
label_dir : Scribble
/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:563: UserWarning: This DataLoader will create 8 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
warnings.warn(_create_warning_msg(
Parameters...
datapath : /content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test
mode : test
label_dir : Scribble
/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py:563: UserWarning: This DataLoader will create 4 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
warnings.warn(create_warning_msg(
initialize net
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00012.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00012.png
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00018.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00018.png
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00012.jpg'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00018.jpg'): can't open/read file: check file path/integrity
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00061.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00061.png
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00064.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00064.png
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00061.jpg'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00064.jpg'): can't open/read file: check file path/integrity
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00079.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00079.png
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00079.jpg'): can't open/read file: check file path/integrity
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00071.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00071.png
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00071.jpg'): can't open/read file: check file path/integrity
Traceback (most recent call last):
File "/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/train.py", line 180, in
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00090.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00090.png
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00090.jpg'): can't open/read file: check file path/integrity
train(dataset, Net, cfg, tm, start_from=0)
File "/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/train.py", line 123, in train
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00087.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00087.png
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00087.jpg'): can't open/read file: check file path/integrity
mae = validate_multiloader(net, val_loaders)
File "/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/train.py", line 77, in validate_multiloader
mae = validate(model, v)
File "/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/train.py", line 61, in validate
for image, mask, shape, name in val_loader:
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 681, in next
data = self._next_data()
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 1376, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 1402, in _process_data
data.reraise()
File "/usr/local/lib/python3.10/dist-packages/torch/_utils.py", line 461, in reraise
raise exception
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/data/dataset.py", line 108, in getitem
image = cv2.imread(imagepath).astype(np.float32)[:,:,::-1]
AttributeError: 'NoneType' object has no attribute 'astype'
********/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00088.jpg
******/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/GT/CAMO/Image/camourflage_00088.png
[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/content/drive/MyDrive/camouflaged/scribble/Weakly-Supervised-Camouflaged-Object-Detection-with-Scribble-Annotations/CodDataset/test/Image/CAMO/Image/camourflage_00088.jpg'): can't open/read file: check file path/integrity