NVIDIA / FastPhotoStyle

Style transfer, deep learning, feature transform
Other
11.11k stars 1.2k forks source link

AttributeError: 'Image' object has no attribute 'shape' #87

Closed galoisgroupcn closed 5 years ago

galoisgroupcn commented 5 years ago

Hi All,

I'm running Example 2 after I have all the 'labelme' files ready in folder. After I type:

!python demo.py \ --content_image_path images/content/img.png --content_seg_path images/content/label.png --style_image_path images/style/img.png --style_seg_path images/style/label.png --output_image_path results/example1.png

Here's the error message I got:

Resize image: (940,941)->(940,941) Resize image: (2000,1992)->(960,956) Elapsed time in stylization: 2.049183 Elapsed time in propagation: 0.079503 Traceback (most recent call last): File "demo.py", line 47, in no_post=args.no_post File "/content/drive/FastPhotoStyle/process_stylization.py", line 131, in stylization out_img = smoothing_module.process(out_img, cont_pilimg) File "/content/drive/FastPhotoStyle/photo_smooth.py", line 45, in process content = self.replication_padding(content,2) File "/content/drive/FastPhotoStyle/photo_smooth.py", line 95, in replication_padding h,w,c = arr.shape AttributeError: 'Image' object has no attribute 'shape'

I assume someone has encountered similar problem with photo_smooth.py. Could someone help me please? Thanks in advance!

Sincerely,

Amber

@mingyuliutw @Yijunmaverick @suquark @wesleyw72