StoryGAN icon indicating copy to clipboard operation
StoryGAN copied to clipboard

Using python 3.7.4 after modified np.load(image_path +'CLEVR_dict.npy' , allow_pickle=True, encoding='bytes').item()

Open CyberFork opened this issue 5 years ago • 2 comments

Traceback (most recent call last): File "main_clevr.py", line 99, in algo.train(imageloader, storyloader, testloader) File "P:\StoryGAN\code\trainer.py", line 100, in train netG, netD_im, netD_st = self.load_networks() File "P:\StoryGAN\code\trainer.py", line 49, in load_networks netG = StoryGAN(self.video_len) File "P:\StoryGAN\code\model.py", line 222, in init self.define_module() File "P:\StoryGAN\code\model.py", line 234, in define_module nn.Linear(ninput, ngf * 4 * 4 / 2, bias=False), File "P:\Python37\lib\site-packages\torch\nn\modules\linear.py", line 72, in init self.weight = Parameter(torch.Tensor(out_features, in_features)) TypeError: new() received an invalid combination of arguments - got (float, int), but expected one of: * (torch.device device) * (torch.Storage storage) * (Tensor other) * (tuple of ints size, torch.device device) didn't match because some of the arguments have invalid types: (float, int) * (object data, torch.device device) didn't match because some of the arguments have invalid types: (float, int)

CyberFork avatar Sep 02 '19 03:09 CyberFork

The current .npy is saved by python2. There should be some compatibility issue. The easiest solution may be using python 2 to open and see the data structure. Then generate a new .npy file from python 3.

yitong91 avatar Sep 19 '19 17:09 yitong91

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date.

martinezhermes avatar Sep 23 '19 09:09 martinezhermes