0

f_name is the address of my image. i get the image using the Image.open method in PIL package. then type converted it to unit8. then tried to resize using resize method.

img=Image.open(f_name)

#img = get_image(f_name, LOAD_SIZE, is_crop=True, bbox=bbox)
#img = img.astype('uint8')
img=np.uint8(img)

hr_images.append(img)
#lr_img = scipy.misc.imresize(img, [lr_size, lr_size], 'bicubic')
lr_img=img.resize([lr_size,lr_size])#errror in this statement
#new_image = image.resize((400, 400))
lr_images.append(lr_img)

the error i get is

  File "C:\Users\Monica.R\Desktop\STACKGAN123\misc\preprocess_birds.py", line 89, in save_data_list
    lr_img=img.resize([lr_size,lr_size])
ValueError: cannot resize this array: it does not own its data
wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • 1
    Possible duplicate of [Numpy, the array doesn't have its own data?](https://stackoverflow.com/questions/23253144/numpy-the-array-doesnt-have-its-own-data) – Evan Sep 26 '19 at 19:00
  • i don't understand.can you explain with my code@Evan – Monisha Ravi Sep 27 '19 at 17:16

0 Answers0