example_parser_configuration_pb2 import issue for tensorflow - python

Using Python 2.7 (miniconda) and trying to run below example, but it is said Unresolved reference to example_parser_configuration_pb2, does anyone have any solutions?
BTW, my machine is configured with tensorflow and I can run some tensorflow examples, so tensorflow basic configuration should be ok.
from tensorflow.core.example import example_parser_configuration_pb2
https://github.com/tensorflow/tensorflow/blob/754048a0453a04a761e112ae5d99c149eb9910dd/tensorflow/python/util/example_parser_configuration_test.py#L70
regards,
Lin

Related

which python and tensorflow version is used to train DeepLab v3+ using tensorflow api?

I have been getting multiple errors which are due to conflicts in the TensorFlow version installed in my system and the version used to write the code in Tensorflow API.
I am using python 3.6.7 and Tensorflow 2.0 to get started with the code https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/installation.md
But I am getting several errors :
flags = tf.app.flags
AttributeError: module 'tensorflow' has no attribute 'app.
As I am using 2.0 , I replaced tf.app.flags with tf.compat.v1.flags.
from tensorflow.contrib import slim as contrib_slim
ModuleNotFoundError: No module named 'tensorflow.contrib'
I am not able to solve the second one.
Can I get help to know which python and tensorflow version should be used to run DeepLab v3+?
You should use the Tensorflow version 1.x to run the DeepLabV3+ model because it uses a session to run and also the slim library which is based on the TensorFlow 1.x. And so your two problems can be solved as:
Do not need to replace tf.app.flags with tf.compat.v1.flags.
To run DeepLabV3+ model, you need to put deeplab and slim folder in a folder (deeplab_slim),
and export them by running following export commands from this parent folder (deeplab_slim):
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/deeplab

Unable to train dataset for RCNN due to attribute error?

I am currently following the tutorial by EdjeElectronics: https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10#1-install-anaconda-cuda-and-cudnn and I am in the step no:6. Run the Training. I had certain errors before but I cleared them so I have generated the TFrecords and I am stuck here.image
If there are any files that I need to attach for your convenience pls let me know.
The contrib attribute has moved out of Tesnsorflow version 2.
To use version 1, replace the 'import tensorflow as tf' line as follows:
#import tensorflow as tf
import tensorflow.compat.v1 as tf #using v1 of tf
Actually, when looking at this link - https://www.tensorflow.org/guide/migrate, there is a line -
It is still possible to run 1.X code, unmodified (except for contrib), in TensorFlow 2.0
The link goes to page - https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md which explains what happened to each contrib module.
You can try to migrate code to Tensorflow 2 or whatever version you are using.
Another alternative is to uninstall your Tensorflow installation and install Tensorflow with version 1.x.

TensorFlow object detection module import issue

I started to learn object detection with TensorFlow from this tutorial but have some problems with trainer import module.
I've downloaded Tensorflow models and protoc-3.4.0-win32 and already compiled object_detection\protos for Python, also prepared images with labels and set enviroment variables.
Now everything is fine but an error occurs while running 3_train.py script from this repo:
File "C:\Users\Username\Desktop\TensorFlow\TensorFlow_Tut_3_Object_Detection_Walk-through-master\3_train.py", line 11, in <module>
from object_detection import trainer
ImportError: cannot import name 'trainer'
I don't know how to fix this error. I'am using Python 3.6.6 on Win7x64.
Any advice will be appreciated!
I think you have to clone the github repo for tensorflow object detection models. https://github.com/tensorflow/models. 3_train.py needs object_detection/trainer.py.
Best regards.

Import Error of TensorFlow in Visual Studio Code

I work on the python code in VS Code for image processing and i need to use tensorflow. When I want to import tensorflow i get this error:
import tensorflow as tf
E0401:Unable to import 'tensorflow'
I have read ImportError: No module named tensorflow for Visual Studio Code but it is used for working with GPU but I only want to work with CPU.
How can I fix it?
Thanks in advance.
You should create an environment for your python project.
After that, you should install tensorflow with pip.

Failure to import sknn.mlp / Theano

I'm trying to use scikit-learn's neural network module in iPython... running Python 3.5 on a Win10, 64-bit machine.
When I try to import from sknn.mlp import Classifier, Layer , I get back the following AttributeError: module 'theano' has no attribute 'gof' ...
The command line highlighted for the error is class DisconnectedType(theano.gof.type.Type), within theano\gradient.py
Theano version is 0.8.2, everything installed via pip.
Any lights on what may be causing this and how to fix it?
Apparently it was caused by some issue with Visual Studio. The import worked when I reinstalled VS and restarted the computer.
Thanks #super_cr7 for the prompt reply!

Categories

Resources