Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : #13

Open
neelkadia-zz opened this issue Aug 16, 2017 · 1 comment
Open

Error : #13

neelkadia-zz opened this issue Aug 16, 2017 · 1 comment

Comments

@neelkadia-zz
Copy link

dataset_path = './datasets/'
celebA_path = os.path.join(dataset_path, 'celebA')
handbag_path = os.path.join(dataset_path, 'edges2handbags')
shoe_path = os.path.join(dataset_path, 'edges2shoes')
facescrub_path = os.path.join(dataset_path, 'fonts')
chair_path = os.path.join(dataset_path, 'rendered_chairs')
face_3d_path = os.path.join(dataset_path, 'PublicMM1', '05_renderings')
face_real_path = os.path.join(dataset_path, 'real_face')
car_path = os.path.join(dataset_path, 'data', 'cars')

def shuffle_data(da, db):
    a_idx = range(len(da))
    np.random.shuffle( a_idx )

    b_idx = range(len(db))
    np.random.shuffle(b_idx)

    shuffled_da = np.array(da)[ np.array(a_idx) ]

Giving error on the last line :


Traceback (most recent call last):
  File "./discogan/image_translation.py", line 314, in <module>
    main()
  File "./discogan/image_translation.py", line 181, in main
    data_style_A, data_style_B = shuffle_data( data_style_A, data_style_B)
  File "/Users/kadia/Desktop/DiscoGAN-master/discogan/dataset.py", line 27, in shuffle_data
    shuffled_da = np.array(da)[ np.array(a_idx) ]
IndexError: arrays used as indices must be of integer (or boolean) type
@shadow111
Copy link

i think it's something related to the n_test argument in image_translation.py, by default they are 200 so you have to be sure that your dataset contain more than 200 image or you have to change it.
i got the same error for my dataset(197 images) i change it to 10 and the training works very well.
Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants