You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Example of 'Transfer Learning' on multiple layers with TensorFlow.NET #248
I was checking out the TensofFlow samples available in the repo but looks like in all of them (Image Classification, Object Detection) the samples are just running/scoring pre-trained TensorFlow models such as Inception v3:
Do you have (is it possible with TensorFlow.NET?) any example on how to do 'Transfer Learning' with TensorFlow.NET such as training with new images on the final layer and even on multiple layers (and ultimately possibility for the full network) of the TF network?
The following is a basic 'Transfer Learning' sample using Keras/Python.
@CESARDELATORRE Absolutly tf.net can train and predict image. I'll try my best to do an example for your case and upload to Example project. Please check the RetrainImageClassifier example. It's not finished yet currently.
@Oceania2018 - Cool! - I'll learn about it as soon as possible!
Btw, I was just testing the samples and it gave me an error/exception in VS when running the samples, here:
System.Exception
HResult=0x80131500
Message=SemanticPredictions:0 is both fed and fetched.
Source=TensorFlow.NET
StackTrace:
at Tensorflow.Status.Check(Boolean throwException) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Status\Status.cs:line 48
at Tensorflow.BaseSession._call_tf_sessionrun(KeyValuePair2[] feed_dict, TF_Output[] fetch_list, List1 target_list) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 214
at Tensorflow.BaseSession._do_run(List1 target_list, List1 fetch_list, Dictionary2 feed_dict) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 189 at Tensorflow.BaseSession._run(Object fetches, FeedItem[] feed_dict) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 142 at Tensorflow.BaseSession.run(Object fetches, FeedItem[] feed_dict) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 45 at TensorFlowNET.Examples.ImageProcess.ImageBackgroundRemoval.<>c__DisplayClass15_0.<Run>b__0(Session sess) in D:\GitRepos\TensorFlow.NET\test\TensorFlowNET.Examples\ImageProcess\ImageBackgroundRemoval.cs:line 42 at Tensorflow.Python.with[T](T py, Action1 action) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Python.cs:line 88
I am getting an error about InceptionV3.meta not being loadable due to mismatched attributes. I believe this is a issue with using InceptionV3.meta on any version of TensorFlow higher than 1.4 (I am using 1.13 from the documentation), do you know of a work around?
Activity
Oceania2018 commentedon May 17, 2019
@CESARDELATORRE Absolutly tf.net can train and predict image. I'll try my best to do an example for your case and upload to Example project. Please check the RetrainImageClassifier example. It's not finished yet currently.
Add a Transfer Learning example for image recognition. #248
add tf.summary #248
add SummaryToEventTransformer, EventProto, SummaryProto. #248
can training and cross validating, but train_saver.save failed. #248
Finished final model evaluation. Freezing graph has not been finished…
Froze trained model is completed. #248.
Oceania2018 commentedon May 24, 2019
@CESARDELATORRE The Transfer Learning example is finished. Let me know if you have any question.
CESARDELATORRE commentedon May 24, 2019
@Oceania2018 - Cool! - I'll learn about it as soon as possible!
Btw, I was just testing the samples and it gave me an error/exception in VS when running the samples, here:
System.Exception
HResult=0x80131500
Message=SemanticPredictions:0 is both fed and fetched.
Source=TensorFlow.NET
StackTrace:
at Tensorflow.Status.Check(Boolean throwException) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Status\Status.cs:line 48
at Tensorflow.BaseSession._call_tf_sessionrun(KeyValuePair
2[] feed_dict, TF_Output[] fetch_list, List1 target_list) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 214at Tensorflow.BaseSession._do_run(List
1 target_list, List1 fetch_list, Dictionary2 feed_dict) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 189 at Tensorflow.BaseSession._run(Object fetches, FeedItem[] feed_dict) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 142 at Tensorflow.BaseSession.run(Object fetches, FeedItem[] feed_dict) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Sessions\BaseSession.cs:line 45 at TensorFlowNET.Examples.ImageProcess.ImageBackgroundRemoval.<>c__DisplayClass15_0.<Run>b__0(Session sess) in D:\GitRepos\TensorFlow.NET\test\TensorFlowNET.Examples\ImageProcess\ImageBackgroundRemoval.cs:line 42 at Tensorflow.Python.with[T](T py, Action1 action) in D:\GitRepos\TensorFlow.NET\src\TensorFlowNET.Core\Python.cs:line 88Oceania2018 commentedon May 25, 2019
Seems like you’re running a unfinished example: TensorFlowNET.Examples.ImageProcess.ImageBackgroundRemoval.
CESARDELATORRE commentedon May 25, 2019
I'm running the whole project from VS. It'd be good to either split the samples or to comment the call invoking a sample that is not finished?
Oceania2018 commentedon May 25, 2019
Check this file: https://github.com/SciSharp/TensorFlow.NET/blob/master/test/TensorFlowNET.Examples/Program.cs, you can pass example.Name to run specific example only.
fix training data download issue. #248
PranovD commentedon Jun 11, 2019
File RetrainImageClassifier.cs Line 362
I am getting an error about InceptionV3.meta not being loadable due to mismatched attributes. I believe this is a issue with using InceptionV3.meta on any version of TensorFlow higher than 1.4 (I am using 1.13 from the documentation), do you know of a work around?
tensorflow/models#4093
fix tfhub cache issue for RetrainImage example. #248
fix checkpoint filename when global step is not set. #248
fix tfhub cache issue for RetrainImage example. SciSharp#248
fix checkpoint filename when global step is not set. SciSharp#248