Comments (7)
Hey @arminXerror, I have given a sample code to perform just prediction in another issue, please check #4 (comment). I haven't tested the code, but you can get the idea.
from tensorflow-cnn-finetune.
- You should try different values, every dataset is different. In my experiences, I got best scores with
224,256
. - Yes.
- Yes.
- If you want to online training, you can think like a batch with size 1.
- You should search and implement it yourself. You have already asked about confusion matrix in #5.
from tensorflow-cnn-finetune.
If the number of your classes is not 1000, the weights of final layer is initialised from scratch. You don't have to do anything.
from tensorflow-cnn-finetune.
In fact skip_layers
is not used at all. Look at load_original_weights
method:
tensorflow-cnn-finetune/resnet/model.py
Lines 93 to 108 in 125e343
Initially it was used for skipping weight transfer for that layers. Later, I commented out that check because I wanted to transfer weights for all layers except the last layer. Starting these layers from transferred weights performs better than initialising random. If you want to initalise them random, you can uncomment these 2 lines.
from tensorflow-cnn-finetune.
Hey @dgurkaynak,
Sorry for taking your time, I am trying to understand your code line by line and have questions in my mind I would be appreciated if you can help me to find out the answer.
-
In the line for multi_scale should I give a number for multi_scale or it has a default number which is 2?
tf.app.flags.DEFINE_string('multi_scale', ' **??** ', 'As preprocessing; scale the image randomly between 2 numbers and crop randomly at network\'s input size')
-
Are you calculating the accuracy as average accuracy on each epoch? for example, if I have 3K images for my val_data and batch size is 128. According to this line
val_batches_per_epoch = np.floor(len(val_preprocessor.labels) / FLAGS.batch_size).astype(np.int16)
my val_batches_per_epoch is 23 which means for completing 1 epoch, you are feeding network 23 times and each time you calculate the accuracy and at the end of the first epoch you sum up all accuracy and get the average, am I right? -
If I want to know about training accuracy should I do it as follow:
opt, tr_acc = sess.run([train_op, accuracy], feed_dict={x: batch_xs, y: batch_ys, is_training: True})
and then print the tr_acc. Is it a correct way to get train accuracy? -
If I want to feed network without batch size what should be variable?
feed_dict={x: batch_xs, y: batch_ys, is_training: False})
I mean what should be the variable for x and y without next batch, I have tried val_preprocessor.images for x and val_preprocessor.labels but I got an error which these 2 are string and must be float. you are reading images from text file and converting the images and labels to numpy array, how can i get these numpy array in finetune.py ? -
Could you please help me to get the accuracy for each category if you have 10 categories and wants to know accuracy of each one and plot curves per category for your network?
I know is so much....
thanks in advance.
from tensorflow-cnn-finetune.
Hey @dgurkaynak,
I really appreciate your help.
If I want to remove the weights of the final layer and "re-train" the net again with the new data set. Should I do as follow?
In ResNet, you load pre-trained weights as follow:
model.load_original_weights(sess, skip_layers=train_layers)
which, train_layers
is FC layer
in ResNet.
should I just remove skip_layers and change the line like below?
model.load_original_weights(sess)
is going to re-train the net again with my new data set or I have to change another part as well?
Thanks in advance.
from tensorflow-cnn-finetune.
Hey @dgurkaynak,
Great, I have 10 classes in my dataset.
What will happen to the network if I remove skip_layers as explained?
Where did you define for the network if the number of classes is less than 1000, the weights of the final layer will initialize from scratch?
Thanks in advance.
from tensorflow-cnn-finetune.
Related Issues (17)
- resnet url is unavailable and in BatchPreprocessor the mean_color is from ImageNet? HOT 1
- Do you have code for classifying images? HOT 1
- [THX] Your code has helped me a lot. Thank you very much HOT 1
- A problem about fine-tuning for resnet HOT 4
- Which version of ResNet you implemented here? HOT 1
- Question about inference HOT 1
- how to use the model created HOT 1
- ckpt 2 npy HOT 1
- About the updating of moving_mean and moving_variance
- ImportError:cannot import name BatchPreprocessor HOT 2
- support for multi-GPU HOT 1
- Does VGG not support training with CPU? HOT 6
- Confusion Matrix HOT 3
- Converting image RGB to BGR HOT 1
- About AlexNet HOT 1
- IndexError: list index out of range HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow-cnn-finetune.