-
Notifications
You must be signed in to change notification settings - Fork 53
Using custom data using IMNET option #20
Comments
Hi, this might come from the way your images are normalized. By default the code assumes images are in ImageNet format and normalizes them to ImageNet standard deviation (see https://github.com/facebookresearch/convit/blob/main/datasets.py#L193). |
It did! |
Hi @NouranFadlallah and @sdascoli, I am trying to test out ConViT with my own custom dataset (based on cotton leaves). It is composed of two classes (healthy and diseased). I ran into a couple of issues getting ConViT to work in Colab. I tried what @NouranFadlallah did and set up my environment, but initialising the I ran the following command:
The error was the following:
The only change I made was upgrading timm to the latest version since otherwise the command would not work due to it giving an error stating: I am not sure if I am missing anything obvious since I have the folders setup correctly with the data on Google Drive? |
Hello,
I'm trying to train the model on a custom medical dataset with two classes (normal and abnormal) and I'm trying to use IMNET option since it loads data from specified directory. However, the model doesn't seem to train (Accuracy is always around 55%). While debugging I noticed the loaded images are totally black.
when running this code on colab:
!python -m torch.distributed.launch --use_env /content/convit/main.py --epochs 50 --mixup 0.8 --model convit_base --drop 0.7 --batch-size 32 --nb_classes 2 --output_dir /content/drive/MyDrive/models/convit/ --data-path /content/drive/MyDrive/ct_data/RawConvit/
I added this code (in main.py after defining data_loader_train) to check the generated images:
where img.png is a totally black image and the print commands give -1.1072767 and -2.117904
My dataset has the following structure, and the code reads the number of classes / images correctly:
The text was updated successfully, but these errors were encountered: