It seems that the alexnet_v2 preprocessing function is missing.
If I try to train alexnet_v2 model with
python train_image_classifier.py
I got the following error
ValueError: Preprocessing name [alexnet_v2] was not recognized
Of course on the preprocessing directory there is no alexnet_v2 key in the preprocessing_factory.py nor an alexnet_preprocessing.py file
Hello, @abes975 , you need to add it by yourself
@argman Well that's surely a way to do, but I thought that as alexnet is a model included in slim/nets it should be trainable using the train_image_classifier on flowers. mnist data set for example without writing any code.
@sguada could you take a look at this? Thanks.
@abes975 This may work for you.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
slim = tf.contrib.slim
def preprocess_image(image, output_height, output_width, is_training=False):
resized_image = tf.image.resize_image_with_crop_or_pad(image, output_width, output_height)
tf.summary.image('image', tf.expand_dims(image, 0))
return tf.image.per_image_standardization(resized_image)
Thanks @snnn! @abes975 does @snnn's solution work for you?
@yifeif thanks a lot!
Yes it perfectly answered my question!
Thanks!
@snnn @abes975 @yifeif unfortunately, training alexnet_v2 using that led to 0% accuracy. Could you have a look at #5311
Most helpful comment
@abes975 This may work for you.