bioinf-jku/TTUR

Problem using image dataset already in numpy format

miqbal23 opened this issue · 1 comments

Hello, I have a problem in using your code on my custom dataset.

My dataset is a collection of images already in npz format, and I'm able to extract it directly without had to do imread first. But I did an initial resize since my image is in 1-channel format

dataset = np.load('dataset_file.npz')
x_test_target = dataset['img_set'].astype('float32')
x_test_target = np.reshape(x_test_target, (len(x_test_target), row, col, chann))
x_test_target.resize((row, col, 3))

After resizing, I tested it using the calculate_activation_statistics method to see if Inception able to receive it as input

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    mu_real, sigma_real = fid.calculate_activation_statistics(x_test_target, sess, batch_size=100)

But I receive this error,

ValueError: Cannot feed value of shape (100, 128, 3) for Tensor 'FID_Inception_Net/ExpandDims:0', which has shape '(?, ?, ?, 3)'

Is there something wrong with my data setup? Or the batch_size setup not suitable with my data?

Sorry, I found which cause the problem

Apparently my resize operation is causing the resulted output to be (128,128,3), excluding the dimension of number of data in there. The resize should be like this

x_test_target = np.resize(x_test_target , (len(x_test_target), row, col, 3))