ganomaly icon indicating copy to clipboard operation
ganomaly copied to clipboard

Custom dataset

Open fnex opened this issue 5 years ago • 8 comments

Hi,

Thank you for the code, I tested it on the mnist and cifar datasets and it works fine.

I admit I'm very new with Pytorch, so it is possible that I'm making a very basic mistake.

I tried to upload my own dataset (RGB images 80x80 pixels) following the same structure you suggested. I used .png format and named the images exactly as you did.

The command I give is train.py --dataset mydata --isize 80 --niter 10

My problem is the code runs but it never start working (I have just one core at 100% but no GPU usage). data.py sees the files in the folders correctly. I also tried to debug the rest of the code without big success. The run enters in model = Ganomaly(opt, dataloader) but never gets out.

I changed the size of the dataset (reducing the images), but it seems to give the same problem. Interrupting the code, it is always at the same point: File "/data/myPC/ganomaly/lib/networks.py", line 169, in __init__ self.decoder = Decoder(opt.isize, opt.nz, opt.nc, opt.ngf, opt.ngpu, opt.extralayers)

Thank you in advance for your answer!

fnex avatar Aug 29 '19 14:08 fnex

hey,can you tell me how to train in custom dataset?

PolynomialQian avatar Oct 29 '19 01:10 PolynomialQian

I have the same problem with you. Have you solved it now?

heytan avatar Dec 03 '19 08:12 heytan

I finally find out that there is a bug in networks.py Class Decoder line 89-92. `

    cngf, tisize = ngf // 2, 4
    while tisize != isize:
        cngf = cngf * 2
        tisize = tisize * 2

` since your input imags size is 80, this circle would never stop, since 'tisize'(4,8,16,32,64,128,.....) will never equals isize(80).

heytan avatar Dec 03 '19 09:12 heytan

If the Custom Dataset is configured as below, is the abnormal data of train folder also trained?

Custom Dataset
├── test
│   ├── 0.normal
│   │   └── normal_tst_img_0.png
│   │   └── normal_tst_img_1.png
│   │   ...
│   │   └── normal_tst_img_n.png
│   ├── 1.abnormal
│   │   └── abnormal_tst_img_0.png
│   │   └── abnormal_tst_img_1.png
│   │   ...
│   │   └── abnormal_tst_img_m.png
├── train
│   ├── 0.normal
│   │   └── normal_tst_img_0.png
│   │   └── normal_tst_img_1.png
│   │   ...
│   │   └── normal_tst_img_t.png
│   ├── 1.abnormal
│   │   └── abnormal_tst_img_0.png
│   │   └── abnormal_tst_img_1.png
│   │   ...
│   │   └── abnormal_tst_img_u.png

youngkiu avatar Feb 20 '20 03:02 youngkiu

have you run the code succssuffuly on your dataset?

lzzlxxlsz avatar Mar 29 '20 15:03 lzzlxxlsz

yes,but the result it is not successful, so i give up

At 2020-03-29 23:50:57, "lzzlxxlsz" [email protected] wrote:

have you run the code succssuffuly on your dataset?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

PolynomialQian avatar Mar 30 '20 01:03 PolynomialQian

yes,but the result it is not successful, so i give up At 2020-03-29 23:50:57, "lzzlxxlsz" [email protected] wrote: have you run the code succssuffuly on your dataset? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

how dou you test your data ? does the test code made by yourself?

lzzlxxlsz avatar Apr 02 '20 06:04 lzzlxxlsz

no, i never test

At 2020-04-02 14:48:09, "lzzlxxlsz" [email protected] wrote:

yes,but the result it is not successful, so i give up At 2020-03-29 23:50:57, "lzzlxxlsz" [email protected] wrote: have you run the code succssuffuly on your dataset? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

how dou you test your data ? does the test code made by yourself?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

PolynomialQian avatar Apr 03 '20 07:04 PolynomialQian