Open abhisheksrivastava2397 opened 5 years ago
here i have a batch size of 64 images image shape is(112,96,3) i want to extract features of self.input and self.G of the entire batch but the model cant take entire batch as input at once
@abhisheksrivastava2397, Can you share your snippets to reproduce the error?
>>> print(tf.__version__)
2.0.0
Try:
cce = tf.keras.losses.CategoricalCrossentropy()
t = [[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]
y = [[.9, .05, .05], [.5, .89, .6], [.05, .01, .94]]
loss = cce(t,y)
Error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/llu/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keses.py", line 126, in __call__
losses = self.call(y_true, y_pred)
File "/home/llu/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keses.py", line 221, in call
return self.fn(y_true, y_pred, **self._fn_kwargs)
File "/home/llu/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keses.py", line 978, in sparse_categorical_crossentropy
y_true, y_pred, from_logits=from_logits, axis=axis)
File "/home/llu/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/kekend.py", line 4503, in sparse_categorical_crossentropy
output.op.type != 'Softmax'):
AttributeError: 'list' object has no attribute 'op'
And this is standard example from tensorflow: https://www.tensorflow.org/api_docs/python/tf/keras/losses/CategoricalCrossentropy
@abhisheksrivastava2397 any progress on this?
`import os import tensorflow as tf from generator import Generator from discriminator import Discriminator from keras.applications.vgg16 import VGG16 from keras.preprocessing import image from keras.applications.vgg16 import preprocess_input import numpy as np from keras.layers import Input, Flatten, Dense
class AACNN(): """AACNN model. """ def init(self, sess, FLAGS): """Initialization.
`