TensorFlow: “Cannot capture a stateful node by value” in tf.contrib.data API
问题 For transfer learning, one often uses a network as a feature extractor to create a dataset of features, on which another classifier is trained (e.g. a SVM). I want to implement this using the Dataset API (tf.contrib.data) and dataset.map(): # feature_extractor will create a CNN on top of the given tensor def features(feature_extractor, ...): dataset = inputs(...) # This creates a dataset of (image, label) pairs def map_example(image, label): features = feature_extractor(image, trainable=False