Color2Embed icon indicating copy to clipboard operation
Color2Embed copied to clipboard

how to train with custom dataset?

Open marziyemahmoudifar opened this issue 1 year ago • 7 comments

Hi, I want to train this code with my own dataset. How can I give my dataset as input to the network?

marziyemahmoudifar avatar Oct 06 '22 10:10 marziyemahmoudifar

Dear Marziye,

If you want to use your dataset, I recommend you to edit the codes of dir https://github.com/zhaohengyuan1/Color2Embed/blob/main/data/prepare_data.py.

zhaohengyuan1 avatar Oct 06 '22 13:10 zhaohengyuan1

I edited the data path in the prepare_data.py file, but I got this error (FileNotFoundError: Found no valid file for the classes labels. Supported extensions are: .jpg, .jpeg, .png, .ppm, .bmp, .pgm, .tif, .tiff, .webp) and I don't know what the label is. Can you tell me what the label is? I have encountered this error for a long time and it cannot be solved.

marziyemahmoudifar avatar Oct 06 '22 17:10 marziyemahmoudifar

You could follow the indication of error information to check the correctness of the path you gave.

zhaohengyuan1 avatar Oct 07 '22 00:10 zhaohengyuan1

I gave my own dataset as input to the prepare_data.py, but it gives this error. How should I define the class? Make dataset of image sizes: 256 Traceback (most recent call last): File "prepare_data.py", line 81, in imgset = datasets.ImageFolder(args.path) File "/home/gadmin/yolov5/lib/python3.8/site-packages/torchvision/datasets/folder.py", line 310, in init super(ImageFolder, self).init(root, loader, IMG_EXTENSIONS if is_valid_file is None else None, File "/home/gadmin/yolov5/lib/python3.8/site-packages/torchvision/datasets/folder.py", line 145, in init classes, class_to_idx = self.find_classes(self.root) File "/home/gadmin/yolov5/lib/python3.8/site-packages/torchvision/datasets/folder.py", line 221, in find_classes return find_classes(directory) File "/home/gadmin/yolov5/lib/python3.8/site-packages/torchvision/datasets/folder.py", line 42, in find_classes raise FileNotFoundError(f"Couldn't find any class folder in {directory}.") FileNotFoundError: Couldn't find any class folder in ../train/apple.

marziyemahmoudifar avatar Oct 08 '22 05:10 marziyemahmoudifar

@marziyemahmoudifar did u solve the problem??

AsserOssama avatar May 19 '23 13:05 AsserOssama

how ??

On Mon, May 22, 2023 at 8:53 AM zhaohengyuan @.***> wrote:

Yes, I did.

Asser Ossama @.***> 于2023年5月19日周五 06:24写道:

@marziyemahmoudifar https://github.com/marziyemahmoudifar did u solve the problem??

— Reply to this email directly, view it on GitHub < https://github.com/zhaohengyuan1/Color2Embed/issues/4#issuecomment-1554574180 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ALZRVO36TIJLSOG3DRDZ3VDXG5YBZANCNFSM6AAAAAAQ6O6ZI4

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/zhaohengyuan1/Color2Embed/issues/4#issuecomment-1556576237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUHW2RVCO6XO6364KZJI3LLXHL5MJANCNFSM6AAAAAAQ6O6ZI4 . You are receiving this because you commented.Message ID: @.***>

AsserOssama avatar May 22 '23 05:05 AsserOssama

and can u give me dataset structure or sample from it?

On Mon, May 22, 2023 at 8:55 AM Asser Ossama @.***> wrote:

how ??

On Mon, May 22, 2023 at 8:53 AM zhaohengyuan @.***> wrote:

Yes, I did.

Asser Ossama @.***> 于2023年5月19日周五 06:24写道:

@marziyemahmoudifar https://github.com/marziyemahmoudifar did u solve the problem??

— Reply to this email directly, view it on GitHub < https://github.com/zhaohengyuan1/Color2Embed/issues/4#issuecomment-1554574180 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ALZRVO36TIJLSOG3DRDZ3VDXG5YBZANCNFSM6AAAAAAQ6O6ZI4

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/zhaohengyuan1/Color2Embed/issues/4#issuecomment-1556576237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUHW2RVCO6XO6364KZJI3LLXHL5MJANCNFSM6AAAAAAQ6O6ZI4 . You are receiving this because you commented.Message ID: @.***>

AsserOssama avatar May 22 '23 05:05 AsserOssama