Why tensorflow would automatically continue training the model? - python

I'm running my python-project which is about training a neural network with tensorflow at PyCharm, and find that my network has been already well-trained since the second restart of running my project.
I have no command to restore any trained model in my project (I do have commands for saving models). Anyone knows anything about my problem?
Is it possible that tensorflow or pycharm have default settings to save and restore?
Great thanks!

Related

Are tensorflow2 keras models compatible with the Edge TPU?

I am trying to convert the keras model located here: https://www.tensorflow.org/lite/performance/post_training_integer_quant to a model that can run on the Edge TPU. What this example fails to mention is that in order to compile the model to something that is runnable on the TPU it needs to get saved first as a "frozen model" to a .pb file. I tried doing that but the Edge tpu compiler still complains that the model's tensor size's are still not constant. I also read somewhere that tensorflow2 does not support frozen graphs yet. Is that true, and if so, how can I convert this keras model to something that is runnable on the TPU? Does a complete guide for how to write a TPU compatible model exist somewhere?

Tensorflow Object API TF2 not displaying visualizations in Tensorboard

Description
I had a setup for training using the object detection API that worked really well, however I have had to upgrade from TF1.15 to TF2 and so instead of using model_main.py I am now using model_main_tf2.py and using mobilenet ssd 320x320 pipeline to transfer train a new model.
When training my model in TF1.15 it would display a whole heap of scalars as well as detection box image samples. It was fantastic.
In TF2 training I get no such data, just loss scalars and 3 input images!! and yet the event files are huge gigabytes! where as they were in hundreds of megs using TF1.15
The thing is there is nowhere to specify what data is presented. I have not changed anything other than which model_main py file I use to run the training. I added num_visualizations: to the pipeline config file but no visualizations of detection boxes appear.
Can someone please explain to me what is going on? I need to be able to see whats happening throughout training!
Thank You
I am training on PC in virtual environment before performing TRT optimization in Linux but I think that is irrelevant here really.
Environment
GPU Type: P220
Operating System + Version: Win10 Pro
Python Version (if applicable): 3.6
TensorFlow Version (if applicable): 2
Relevant Files
TF1.15 vs TF2 screenshots:
TF1 (model_main.py) Tensorboard Results
TF2 (model_main_tf2.py) Tensorboard Results
Steps To Reproduce
The repo I am working with GitHub Object Detection API
Model
Pipeline Config File
UPDATE: I have investigated further and discovered that the tensorboard settings are being set in Object Detection Trainer 1 for TF1.15 and Object Detection Trainer 2 for TF2
So if someone who knows more than I do about this could work out what the difference is and what I need to do to get same result in tensorboard with v2 as I do with the first one that would be amazing and save me enormous headache. It would seem that this, even though it is documented as being for TF2, is not actually following TF2 syntax but I could be wrong.

Loading keras model into tensorspace

I understand that I have to visualize my model I have to follow to steps: 1) Preprocessing the pre-trained model (lets assume it's called my_model.h5) and 2.) creation of the interactive model.
Further I have created a json file of my model as mentioned within the instructions (Model Preprocessing):https://tensorspace.org/html/docs/preKeras.html
I have node.js installed and I installed tensorspace via npm install tensorspace. However I'm not able to recall the API of tensorspace. Does anyone now if I missed something out?

Is there a way to use a compiled keras model on the RPI Zero?

I am working on a Letter Recognition Application for a robot. I used my home PC for training the model and wanted the recognition to be on the RPI Zero W with the already trained model.
I got an HDF model. When I try to install Tensorflow on the RPI zero, it's throwing a hash error, as far as I found it this is due to TF beeing for 64bit machines. When I try to install Tensorflow Lite, the installation stocks and crashes.
For saving the model I use:
classifier.save('test2.h5')
That are the Prediction lines:
test_image = ks.preprocessing.image.load_img('image.jpg')
test_image = ks.preprocessing.image.img_to_array(test_image)
result = classifier.predict(test_image)
I also tried to compile the python script via Nuitka, but as the RPI is ARM and nuitka is not offering cross-compile, this possibility felt out.
You can use already available TFLite to solve your issue.
If that does not help, you can also build TFLite from source.
Please refer to below links:
https://www.tensorflow.org/lite/guide/build_rpi
https://medium.com/#haraldfernengel/compiling-tensorflow-lite-for-a-raspberry-pi-786b1b98e646

Where is merged distributed keras / tensorflow final model saved?

Excuse me . I have a question . I'm working with a distributed version of tensorflow and keras and I succeeded to make a sample deep learning network work on multiple programs (python scripts) working together but I don't know how to save final single model on one of hosts while currently each script is saving it's own model as checkpoint separately.
Thanks.
Source code I used to develop my program :
Distributed tensorflow / keras code sample on github
For example in the source code above , final model save path is not set , would you tell me how to set it ?

Categories

Resources