hanzhanggit / StackGAN

MIT License
1.86k stars 457 forks source link

Having issues while reproducing #7

Open rajankarthiks opened 7 years ago

rajankarthiks commented 7 years ago

Hello everyone,

I am trying to reproduce the code implemented in this repository. However i am getting stuck at the following error. I have followed the steps in the readme file. Could you guys please guide me what i am missing or tell where i am making mistakes? .

Traceback (most recent call last): |ETA: --:--:-- File "stageI/run_exp.py", line 68, in <module> algo.train() File "/home/ubuntu/gans/gans/stacked-gans/StackGAN/stageI/trainer.py", line 346, in train num_embedding) File "/home/ubuntu/gans/gans/stacked-gans/StackGAN/misc/datasets.py", line 144, in next_batch sampled_images = self.transform(sampled_images) File "/home/ubuntu/gans/gans/stacked-gans/StackGAN/misc/datasets.py", line 78, in transform images[i][w1: w1 + self._imsize, h1: h1 + self._imsize, :] TypeError: slice indices must be integers or None or have an __index__ method

This is the error I am getting.

rajankarthiks commented 7 years ago

Hi. Can someone help me figure this out and move forward please?

alexrakowski commented 7 years ago

I have just stumbled upon this error - what seemed to fix it was to cast all the indices to integers: images[i][int(w1): int(w1 + self._imsize), int(h1): int(h1 + self._imsize), :]

rajankarthiks commented 7 years ago

Thanks @homaralex .. It is working now..

sahil-ag commented 7 years ago

@hanzhanggit can you push this solution to the repository? I was facing the problem.