kwotsin / tensorflow-xception Goto Github PK
View Code? Open in Web Editor NEWTensorFlow implementation of the Xception Model by François Chollet
License: MIT License
TensorFlow implementation of the Xception Model by François Chollet
License: MIT License
I find you don't add the bn ops while inference,is that don't need add this ops in update_ops?
@kwotsin I want to use the Xception model as feature extractor not for classification for my own dataset. According to my understanding to this point, i must have a pretrained model, although tensorflow has a pretrained Xception model over imagenet dataset, i can not use it, because images in my dataset do not have relationships to images in any class of imagenet. So i trained Xception model over my dataset and save model ( .ckpt and .meta files) to have a pretrained model belong to my images. My question is "How to use this saved files ( .ckpt and .meta files) to extract features of my dataset as a matrix it's rows are images and columns are features?
line 42 less'_'before main
how do I prepare the tf record
for record in tf.python_io.tf_record_iterator(tfrecord_file):
not executed,and num_samples=0,how to fix it
I notice the following code sets a batch_norm_fn for slim.conv2d:
batch_norm_params = {
'decay': batch_norm_decay,
'epsilon': batch_norm_epsilon,
}
# Set parameters for batch_norm. Note: Do not set activation function as it's preset to None already.
with slim.arg_scope([slim.conv2d],
normalizer_fn=slim.batch_norm,
normalizer_params=batch_norm_params) as scope:
However, the batch_norm for conv2d has be setted in following code:
#Block 1
net = slim.conv2d(inputs, 32, [3,3], stride=2, padding='valid', scope='block1_conv1')
net = slim.batch_norm(net, scope='block1_bn1')
Is this a intended setting?
Hi @kwotsin,
A bunch of thanks for implementing the xception network on tensorflow. I am looking at page-5 of xception paper (xception) and noticed that in your implementation exit flow residual layer have been initialized at 1024 instead of 728 coming from middle flow (ref:
TensorFlow-Xception/xception.py
Line 117 in 3b8c8d1
Thanks,
-- d
Thank you for sharing so nice codes to us.
I have tested successfully with my code with the AlexNet model which implemented by tensorflow, however there is something wrong with your xception model instead of AlexNet.
Here is the exception in line 66 of xception.py:
InvalidArgumentError (see above for traceback): total number of outputs should be within the range of int which is used in the GPU kernel128 vs 128
[[Node: Xception/block2_dws_conv2/separable_conv2d/depthwise = DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], _device="/job:localhost/replica:0/task:0/cpu:0"](Xception/block2_relu1, Xception/block2_dws_conv2/depthwise_weights/read)]]
Could you give me a hand for this problem?
Thanks
BR!
From Alex, China
@mlopezantequera @kwotsin How about if my dataset is 2D matrix where each image is row vector so, how can i pass this format to the model?
Hi Kwot! Thanks for the Tensorflow Xception.
I run the 1789
steps of the pythong train_flowers.py
on my computer (CPU) and according to the Tensorboard I reached accurrancy=54%
. However after I launch python eval_flowers.py
I get the folllowing output and the model predicts every eval pitcure as dandelion
(I modified the code to print the text label instead of displaying it on the picture) . What am I doing wrong?
python eval_flowers.py
INFO:tensorflow:Restoring parameters from ./log/model.ckpt-1772
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:Epoch: 1/1
INFO:tensorflow:Current Streaming Accuracy: 0.0000
INFO:tensorflow:Global Step 1: Streaming Accuracy: 0.0000 (77.42 sec/step)
INFO:tensorflow:Global Step 2: Streaming Accuracy: 0.1389 (23.17 sec/step)
INFO:tensorflow:Global Step 3: Streaming Accuracy: 0.1528 (18.02 sec/step)
INFO:tensorflow:global_step/sec: 0.033286
INFO:tensorflow:Global Step 4: Streaming Accuracy: 0.1667 (16.17 sec/step)
(...)
INFO:tensorflow:Global Step 10: Streaming Accuracy: 0.2469 (15.40 sec/step)
INFO:tensorflow:global_step/sec: 0.0584161
INFO:tensorflow:Global Step 11: Streaming Accuracy: 0.2472 (15.29 sec/step)
(...)
INFO:tensorflow:Global Step 18: Streaming Accuracy: 0.2484 (14.36 sec/step)
INFO:tensorflow:global_step/sec: 0.0666661
INFO:tensorflow:Global Step 19: Streaming Accuracy: 0.2454 (16.38 sec/step)
(...)
INFO:tensorflow:Global Step 26: Streaming Accuracy: 0.2367 (14.29 sec/step)
INFO:tensorflow:global_step/sec: 0.0666666
INFO:tensorflow:Global Step 27: Streaming Accuracy: 0.2372 (14.73 sec/step)
INFO:tensorflow:Global Step 28: Streaming Accuracy: 0.2428 (14.41 sec/step)
INFO:tensorflow:Global Step 29: Streaming Accuracy: 0.2460 (14.71 sec/step)
INFO:tensorflow:Global Step 30: Streaming Accuracy: 0.2462 (14.35 sec/step)
INFO:tensorflow:Final Streaming Accuracy: 0.2444
INFO:tensorflow:Prediction: dandelion
Ground Truth: dandelion
Probability: 0.30221
INFO:tensorflow:Prediction: dandelion
Ground Truth: dandelion
Probability: 0.302133
INFO:tensorflow:Prediction: dandelion
Ground Truth: dandelion
Probability: 0.302201
INFO:tensorflow:Prediction: dandelion
Ground Truth: tulips
Probability: 0.302064
INFO:tensorflow:Prediction: dandelion
Ground Truth: daisy
Probability: 0.302107
INFO:tensorflow:Prediction: dandelion
Ground Truth: roses
Probability: 0.30195
INFO:tensorflow:Prediction: dandelion
Ground Truth: roses
Probability: 0.302043
INFO:tensorflow:Prediction: dandelion
Ground Truth: dandelion
Probability: 0.3023
INFO:tensorflow:Prediction: dandelion
Ground Truth: tulips
Probability: 0.302177
INFO:tensorflow:Prediction: dandelion
Ground Truth: daisy
Probability: 0.301616
INFO:tensorflow:Model evaluation has completed! Visit TensorBoard for more information regarding your evaluation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.