Open mahaidong opened 4 years ago
@mahaidong have you solved this issue? I am meeting the same error.
I still haven't tried, but @mahaidong suggested changing in variation_bbs_with_target_graph_segments_suppl.py:
if torch.cuda.is_available() : generator.load_state_dict(torch.load(checkpoint)) else: generator.load_state_dict(torch.load(checkpoint, map_location=torch.device('cpu')))
@mahaidong have you solved this issue? I am meeting the same error.
thanks @ennauata mention about it. I got to this far :) https://github.com/mahaidong/housegan/blob/master/variation_bbs_with_target_graph_segments_suppl.py The code can run , and have result. And I interest about this project.
when I run python variation_bbs_with_target_graph_segments_suppl.py , I got error.
$ python variation_bbs_with_target_graph_segments_suppl.py Namespace(batch_size=1, channels=1, exp_folder='exp', latent_dim=128, n_cpu=4, num_variations=4) 5000 target samples: defaultdict(<class 'int'>, {12: 1239, 11: 1727, 10: 2034}) /usr/local/miniconda3/envs/pythonocc/lib/python3.7/site-packages/pygraphviz/agraph.py:1341: RuntimeWarning: Warning: b is not a known color.
warnings.warn(b"".join(errors).decode(self.encoding), RuntimeWarning) variation_bbs_with_target_graph_segments_suppl.py:75: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. plt.tight_layout() (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) (256, 256, 4) tensor([[[[1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.], ..., [1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.]],
Traceback (most recent call last): File "variation_bbs_with_target_graph_segments_suppl.py", line 250, in
save_image(final_images, "./output/resultspage{}_{}.png".format(target_set, page_count), nrow=2*opt.num_variations+1, padding=2, range=(0, 1), pad_value=0.5, normalize=False)
File "/usr/local/miniconda3/envs/pythonocc/lib/python3.7/site-packages/torchvision/utils.py", line 101, in save_image
normalize=normalize, range=range, scale_each=scale_each)
File "/usr/local/miniconda3/envs/pythonocc/lib/python3.7/site-packages/torchvision/utils.py", line 85, in makegrid
.copy(tensor[k])
RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 0