import tensorflow as tf
import numpy as np
import imageio
import matplotlib.pyplot as plt
try:
from scipy import misc
except ImportError :
!pip install scipy
from scipy import misc
training_size = 600
img_size = 640*480
train_images = np.empty(shape=(training_size, 640*480))
import glob
i = 0
for filename in glob.glob('D:/CASIA/Train60/*.jpg'):
image = imageio.imread(filename)
image=tf.reshape(image,[640,480,1])
image =tf.image.resize_image_with_crop_or_pad(image, 128, 128)
train_images[i] = image.reshape(-1)
i+=1
خطای برنامه بالا به صورت زیر است:
'Tensor' object has no attribute 'reshape'
درصورت امکان راهنمایی بفرمایید.
سپاس