taki0112 / senet-tensorflow Goto Github PK
View Code? Open in Web Editor NEWSimple Tensorflow implementation of "Squeeze and Excitation Networks" using Cifar10 (ResNeXt, Inception-v4, Inception-resnet-v2)
License: MIT License
Simple Tensorflow implementation of "Squeeze and Excitation Networks" using Cifar10 (ResNeXt, Inception-v4, Inception-resnet-v2)
License: MIT License
So if I just want to put a layer in the residuum connection, squeeze_abode _layer ok?
`
if residual :
if a.shape[-1] != b.shape[-1]:
a = squeeze_abode _layer (a,class_number,ratio,layer_number)
b = b+a
else:
b = b+a
`
I am not sure how to set ratio and layer_number parameters
Can it support Tensorflow 2.0 with Windows10?
THX!
I train the net in cifar-10 without change any parameter. But the train accuracy only reach 0.81 and the test is about 0.62
I use SE_Inception_v4.py to train the cifar10 data. The code can run normally, but the "train_loss", "train_acc", "test_loss" and "test_acc" are "nan". I try to output "batch_loss" from "_, batch_loss = sess.run([train, cost], feed_dict=train_feed_dict)", the result is "nan". Did anyone meet this problem?
Epoch:【100】 train accuracy:0.9999 test accuracy:0.9487
The flow of tensors is not visible in the graph. The name and variable scoping is not done properly due to which, the tensorboard graph visualizer ends up creating a flat and degenerate graph.
Could you please upload the results on cifar10? Did you reproduce the results in the paper?
The error occurred in "excitation = tf.reshape(excitation,(-1,1,1,32)) ".
Thanks for your reply.
Hi, does anyone how to run the model with a unseen image, here is my code, hv no idea about the tensor name of output layer. Thanks.
import tensorflow as tf
import numpy as np
import cv2
sess=tf.Session()
saver = tf.train.import_meta_graph('model/Inception_resnet_v2.ckpt.meta')
saver.restore(sess, tf.train.latest_checkpoint("model/"))
graph = tf.get_default_graph()
x = tf.placeholder(tf.float32, shape=[None, 32, 32, 3])
src = cv2.imread("./plane.jpg")
src = 2*(src/255.0)-1.0
dst = cv2.resize(src, (32, 32), interpolation=cv2.INTER_CUBIC)
picture = dst.reshape(1, 32, 32, 3)
feed_dict ={x: picture}
op_to_restore = graph.get_tensor_by_name("dense_44/bias/Momentum:1")
print (sess.run(op_to_restore,feed_dict))
In color_preprocessing function, should we use the same mean and standard deviation both in training and testing?
hi, I think squeeze_excitation_layer should be added after inception block ,not inception_resnet block
Am I right ?
Is there pretained model for downloading? Thanks!
Hi,
Before see your paper, I have saw the channel-wise in 'SCA-CNN', I think the two structures are vary similar, could you tell me the difference between them?
Thank you very much!
@taki0112 I want to train new dataset with this model, must I resize the image to 32*32?
I got this error when I retrain the network with my data set.
'tensorflow.python.framework.errors_impl.InvalidArgumentError: Reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero..'
I use a small data set of 525 and class_num is 6. How to modify the number of iterations and the 50,0000 value in the code? (In SE_Inception_v4.py)
I already put the new iteration value to a smaller value, say (iteration_n = len(train_x)/batch_size+ 1)
where batch_sze=128 and use this:
if pre_index + batch_size < batch_size*iteration_n: #in place of 50000
....
Any help is appreciated.
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.