tfprof | Profiling Taskflow Programs through Visualization | Data Visualization library
kandi X-RAY | tfprof Summary
kandi X-RAY | tfprof Summary
Please visit the page Profile Taskflow Programs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tfprof
tfprof Key Features
tfprof Examples and Code Snippets
Community Discussions
Trending Discussions on tfprof
QUESTION
I am training a neural network using Tensorflow's object detetction API to detect cars. I used the following sentdex's youtube video to learn and execute the process.
https://www.youtube.com/watch?v=srPndLNMMpk&t=65s
Also text version of his videos:
Part 1 to 6 of his series.
My training data has ~300 images Test data ~ 20 images
Since I am using the concept of transfer learning, I chose ssd_mobilenet_v1.model.
Tensorflow version 1.10 (on CPU) Python version 3.6
I trained till ~ 8000 steps and an loss of ~1.
Everything runs smoothly till I try to export the inference graph.
I run the following command :
...ANSWER
Answered 2018-Aug-28 at 04:27Interesting to see if you fixed this - I followed the same tutorial and think I have the exact same problem.
Only I had the correct pbtxt files. I'm out of ideas on what has caused this, my next steps will be to try a different model and perhaps move out of the legacy folder.
QUESTION
I want to profile the FLOPs of a very simple neural network model, which is used to classify the MNIST dataset, and the batch size is 128. As I followed the official tutorials, I got the result of the following model, but I cannot understand some parts of the output.
...ANSWER
Answered 2018-Jul-15 at 17:55I'll give it a try:
(1) From this example, looks like the first number is the "self" flops, the second number means the "total" flops under the naming scope. For example: for the 3 nodes respectively named random_uniform (if there is such a node), random_uniform/mul, random_uniform/sub, they respectively take 11.76k, 11.76k, and 1 flops, and in total 23.52k flops.
For another example: 23.83k = 23.52k + 300.
Does this make sense?
(2) The root node is a "virtual" top-level node added by the profiler, which doesn't have a "self" flops , or in other words, it has zero self flops.
(3) Not sure why it is 1. It would help if you can print the GraphDef and find out what this node really is, with print(sess.graph_def)
Hope this helps.
QUESTION
how can i get the number of flops
from tfprof
i have the code as:
ANSWER
Answered 2018-Jun-05 at 23:09First of all, as of now, tfprof.model_analyzer.print_model_analysis
is deprecated and tf.profiler.profile
should be used instead according to the official documentation.
Given that we know the number of FLOP
, we can get the FLOPS (FLOP per second) of a forward pass by measuring run time of a forward pass and divide FLOP/run_time
Let's take an easy example.
QUESTION
I am reviewing tensorflow log and found the following line:
...ANSWER
Answered 2017-Jun-27 at 09:28' ... no flops stats due to incomplete shapes' means that you have unknown [shape] information for some variables, e.g. when you process variable batch size ([None] shape) or a tf.while_loop for arbitrary amount of time, etc.
Accordingly to official tfprof
docs (source):
- It must have known "shape" information for RegisterStatistics('flops') to calculate the statistics. It is suggested to pass in
-run_meta_path
if shape is only known during runtime. tfprof can fill in the missing shape with the runtime shape information from RunMetadata.
As for RunMetadata, there is a tf.RunMetadata()
op in tensorflow, that should be what you need. Usually you pass it to a sess.run()
op.
A solution for this is to pass RunMetadata during runtime, when all the shapes will be defined.
QUESTION
I am attempting to train a TensorFlow model in Windows 10 using these steps: https://github.com/tensorflow/models/tree/master/attention_ocr#requirements
I have installed virtualenv for Windows (following this example)
The source command is not recognized by Windows. Are the additional steps to the virtualenv command required for Windows, or is there an alternative usage of the source command?
Note that the subsequent pip install commands worked (pip, tensorflow_gpu), but when I attempt to train using train.py I get the following error:
...ANSWER
Answered 2017-Jun-27 at 01:21It looks like your virtualenv is configured correctly, but the code you are trying to use imports tf.contrib.tfprof
, which is not currently (as of TensorFlow 1.2) supported on Windows.
However, since tf.contrib.tfprof
is only used to provide profiling information, you should be able to run the code by manually removing the following line from train.py
:
- Line 27:
from tensorflow.contrib.tfprof import model_analyzer
...and passing the flag --show_graph_stats=false
when running the script.
QUESTION
I'm using tfprof in order to get number of flops necessary for model forward path. My model is 3 layer LSTM and fully connected layer afterwards. I've observed that number of computations grows linearly for fully connected layer, while it doesn't changes for LSTM layers. How that could be possible?
tfprof Report for 1 timestamp forward path.
...ANSWER
Answered 2017-Jun-21 at 06:03tfprof does static analysis of your graph and calculate the float operations for each graph node.
I assume you are using dynamic_rnn or something similar that has tf.while_loop. In that case, a graph node appear in graph once but is actually run multiple times at run time.
In this case, tfprof has no way to statically figure out how many steps (timestamp in your word) will be run. Hence, it only counts the float operations once.
A work around for now is probably multiply timesteps by yourself.
QUESTION
From this line I get to know that the new added profile tool is imported, but it seems strange: 1) it cannot be imported from the interactive interface; 2) and when running the mnist example in spyder I also get an error sayinng ImportError: cannot import name 'tfprof_log_pb2'
.
I thought since the tensorflow was instlled in anaconda and then it might be an old version and hence has no tfprof in it. But this would only explain why I cannot run from tensorflow.tools.tfprof import tfprof_log_pb2
directly in the interactive interface(not in the anaconda environment) and cannot explain why it raises an error when I run it in anaconda. It raises this error in spyder, then the version which supports tfprof should be there.
ANSWER
Answered 2017-Jan-07 at 07:20Both of the two answers are right.
In Ubuntu(python2.7 and GPU) I take a short cut and updated the tensorflow from 10 to 12 by:
pip install \
-i https://pypi.tuna.tsinghua.edu.cn/simple/ \
https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp27-none-linux_x86_64.whl
In China I use the mirror in Tsinghua University for much faster installation.
It goes well directly.
But this seems don't apply to Mac(at least for python3.5 and cpu only) even if your version of the tensorflow is 12 or above that file has not been generated(even other two files are already listed there(//anaconda/lib/python3.5/site-packages/tensorflow/tools/tfprof/
). So I just copied that file(it must be the same as that in my Ubuntu, right?) privided by Yaroslav Bulatov to the folder. And it works.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install tfprof
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page