How can I use the TensorFlow Embeddings Projector inside my own GCP VM or Jupterlab instance? - tensorflow

Is there a way of running the Embedding Projector inside my GCP Jupyterlab instance (or through any other GCP service) as opposed to using the public https://projector.tensorflow.org ?
The TensorFlow documentation mentions that Embeddings Projector can be run inside Tensorboard, but doesn't provide any links or details.

Unfortunately there is not an Google Cloud product available that brings those projector functionalities specifically but you can run the projector Tensorboard plugin in AI Notebooks (Jupyterlab) locally.
Here's the source Tensorboard's projector plugin repository and here's the step by step guide where the projector plugin has been used for that specific use case you mentioned. Bear in mind that this step by step guide is done on Tensorflow 1.1x not 2.0.0.
If you want to use Tensorflow 2.0.0 you will need to import the plugin like this
from tensorboard.plugins import projector
and then migrate all the Tensorflow 1.1x code to >= 2.0 described in the guide in order to get the same log files as the guide. If you already have the neccesary files to make your custom projector you just need to select the plugin inside the Tensorboard UI.
Tensorboard Projector plugin selection
You can also make a web embedding into an IFrame if using the public Tensorboard tool (I understand that this is not your case but this might be helpful to other people searching for an alternative solution). Opening an AI Notebook and pasting the following code would do the job.
import IPython
url = 'https://projector.tensorflow.org/'
IPython.display.IFrame(url, width=1333, height=900)
Remember to change the width and height values if you need to.

Related

Can I import tensorflow and keras in Maya , Blender

I am participating in a workshop , where we need to automatically rig characters . Perhaps , we will use deep learning methods . The task is to recognize body parts . My question : Is there a way for connecting tensorflow and keras , or other neural networks with 3D software?
For blender you can follow this tutorial,
https://www.youtube.com/watch?v=J7Iu1rfwbds
I tested it in Blender 2.81 and Python 3.7 by importing pytorch, opencv, sklearn etc. Also the test code provided in the video works correctly. You do not need follow the pandas installation and git cloning shown on the tutorial. Let it install with other bigger packages or install with conda.
Conda environment creation, https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html.
conda create -n MyNamedEnv python=3.7
After environment is created install your required packages. If you have multiple environments its usually in Anaconda3/envs folder. Command to make link,
mklink /j python C:\Users\computer\Anaconda3\envs\MyNamedEnv
To test if it is working go to scripting tab in blender 2.81 delete everything. A to select all and del button to delete. Paste code from below to Text Editor and run script.
https://github.com/virtualdvid/MachineLearning/blob/master/blender/iris_blender.py
Tensorflow and keras should work similarly by installing them in the conda environment and calling them from blender.

Cannot run TensorBoard in Google Cloud JupyterLab instance

It seems that after TensorFlow 2.0 released, TensorBoard cannot be opened in Google Cloud JupyterLab.
When I use Create new TensorBoard function in JupyterLab, and Enter the path of log files that TensorFlow generated, Path window closes and no response.
TensorBoard can successfully run on the same log file last month.
I tried reinstalling/downgrading components including TensorFlow (from 1.13 to 2.0), TensorBoard, JupyterLab notebook, IPython. There is no change. I tried creating a new JupyterLab instance and running TensorBoard on the default (initial) environment, still no response.
Thanks

Cannot find some functions in Python API in tensorflow

I'm trying to convert a model from tensorflow to onnx. The process to do this is like following.
Save a graph_def and a ckpt for weights in tensorflow.
Inspect a graph_def whether it's structure is valid and give us what the inputs and outputs are.
Freeze both of them together into frozen tensorflow graph.
Convert that graph to onnx model.
The problem is in step 2. To inspect the graph definition, I tried to invoke summarize_graph in Graph Transform Tool. But, it wasn't work properly. Next, i found documentation for Graph Transform Tool. According to the documentation they use bazel that is a tool to build and test like maven. It means that I cannot use this function in a tensorflow installed from pip package manager? Only way to use this function is to install a tensorflow from source and build with bazel?
You should be perfectly able to use these features installing TensorFlow from pip. Bazel is used to manage build procedures, you don't need It unless you want to compile TensorFlow from source by yourself.
Try to remove It and reinstall from pip paying attention to choose the right Python setup in case you have multiple Python distributions on your machine.

TensorFlow without jupyter notebook

Do I absolutely need to use jupyter notebook to run TensorFlow in Windows ?
I tried the detect object example with the jupyter notebook, it works but I'm not really comfortable, Im used to notepad++ and running python directly on my windows without virtual environment.
I tried to copy past all the codes but I run into many hugs.
No, it is not compulsory to use Jupyter notebook to run Tensorflow on Windows. I personally use PyCharm as my IDE and Anaconda for dependency management (this is completely optional).
I would recommend you to use a proper IDE instead of notepad++ because it's much easier to do debugging using an IDE. You'll also be cloning a lot from Git when you start developing your own model, and usually the open source models out there has a lot of classes and methods in it (take Google's Inception net for example).
Another alternative would be maybe you can start posting about the bugs you are facing, then we can all start helping you.

Training Tensorflow object detection model on AWS

Tutorial on the github page for Tensorflow object detection API also has information on running the training on Google Cloud Platform.
But I need to run the training on AWS instance. I have the TFRecords files with me. Is there any tutorial etc available for same?Googling doesn't help much.I am new to AWS.
You need to launch an instance which already has Tensorflow installed on it. AWS has prepared AMIs for that.
see here: https://aws.amazon.com/tensorflow/
Then you just upload anything to the instance and run the script.