xinshengwang / S2IGAN

Pytorch Code for S2IGAN
41 stars 8 forks source link

Issue with datasets_pre.py code #4

Closed priyankaupadhyay090 closed 1 year ago

priyankaupadhyay090 commented 2 years ago

while running "sh run/01_Pretrain.sh" file

DATASET_ALL_CLSS_NUM = 200 DATASET_TRAIN_CLSS_NUM = 135

Error:

Namespace(audio_model='Davenet', batch_size=128, cfg_file='cfg/Pretrain/bird_train.yml', data_path='data/birds', exp_dir='', gpu_id=0, image_model='VGG16', img_size=256, lr=0.001, lr_decay=50, manualSeed=200, margin=1.0, momentum=0.9, n_epochs=120, n_print_steps=2, optim='adam', pretrained_image_model=False, resume=True, rnn_type='GRU', save_root='outputs/pre_train/birds', simtype='MISA', tasks='extraction', weight_decay=0.001)

Total filenames: 11788 001.Black_footed_Albatross/Black_Footed_Albatross_0046_18.jpg

Load filenames from: data/birds/train/filenames.pickle (8538)

Traceback (most recent call last):

File "01_Pretrain.sh", line 145, in

dataset = SpeechDataset(cfg.DATA_DIR, 'train',

File "/opt/app/dataset/datasets_pre.py", line 358, in init

seq_labels[unique_id[i]-1]=i

IndexError: index 135 is out of bounds for axis 0 with size 135

code from the datasets_pre.py file:

cacluate the sequence label for the whole dataset

if cfg.DATASET_NAME == 'birds' 
    if self.split =='train':
        unique_id = np.unique(self.class_id)
        seq_labels = np.zeros(cfg.DATASET_ALL_CLSS_NUM)
        for i in range(cfg.DATASET_TRAIN_CLSS_NUM):
            seq_labels[unique_id[i]-1]=i

        self.labels = seq_labels[np.array(self.class_id)-1]
Cm744 commented 2 years ago

Hi, Have you obtained the "train/test spilt files"? If so, Could you share it with me? many thanks!

Cm744 commented 2 years ago

Thanks! email addres: cm2333703@gmail.com. I need all of 3 datasets, especially Flicker8K dataset. BTW, you made "train/test split" features by yourself? If so, could you please tell me how to make that features for a custom dataset.

rishabh004-ai commented 2 years ago

Hello , @priyankaupadhyay090 , Can you please share the train/test split on the email : ranjan.4@iitj.ac.in

rishabh004-ai commented 2 years ago

Thanks for sharing the split files for birds dataset. Can you please explain how did you figured out "how to create the train/test split files for any custom dataset"?

mariamsaed19 commented 1 year ago

Hello @priyankaupadhyay090 Can you please share the train/test split on the email: mariamzaho4@gmail.com for the birds dataset as I want to make sure I've generated them properly? Thanks in advance

oms12 commented 1 year ago

Thanks! email addres: cm2333703@gmail.com. I need all of 3 datasets, especially Flicker8K dataset. BTW, you made "train/test split" features by yourself? If so, could you please tell me how to make that features for a custom dataset.

Are you able to run it on flicker dataset?