How to retrain the inception model (windows)? - tensorflow

I am trying to follow along with the steps for tensorflow for poets 2 and every time I try to retain the inception model with new datasets I get this error.
This is the article I was trying to follow along.
I have reinstalled tensorflow twice.
File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 18, in swig_import_helper fp, pathname, description =
imp.find_module('_pywrap_tensorflow_internal', [dirname(file)])
File "D:\Files\downloades\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No
module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 58, in from
tensorflow.python.pywrap_tensorflow_internal import * File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 28, in _pywrap_tensorflow_internal =
swig_import_helper() File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 20, in swig_import_helper import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"D:\Files\downloades\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec) File "D:\Files\downloades\lib\runpy.py", line
85, in _run_code exec(code, run_globals) File
"C:\Users\Rishi\Desktop\tensorflow-for-poets-2\scripts\retrain.py",
line 109, in import tensorflow as tf File
"D:\Files\downloades\lib\site-packages\tensorflow__init__.py", line
24, in from tensorflow.python import pywrap_tensorflow #
pylint: disable=unused-import File
"D:\Files\downloades\lib\site-packages\tensorflow\python__init__.py",
line 49, in from tensorflow.python import
pywrap_tensorflow File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 74, in raise ImportError(msg) ImportError: Traceback
(most recent call last): File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 18, in swig_import_helper fp, pathname, description =
imp.find_module('_pywrap_tensorflow_internal', [dirname(file)])
File "D:\Files\downloades\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No
module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 58, in from
tensorflow.python.pywrap_tensorflow_internal import * File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 28, in _pywrap_tensorflow_internal =
swig_import_helper() File
"D:\Files\downloades\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py",
line 20, in swig_import_helper import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
For some common reasons and solutions, I have included the entire stack trace
above this error message. How do I solve this problem?

Related

Python file not running properly / TensorFlow

I am running a Python file to train a neural network. The file is from a third source so it should be correct. When running it from IDLE Python I get the following error, but I do not understand what I am doing wrong?
I use Python 3.9.2 and pip installed tensorflow, keras.
Thanks!
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>>
= RESTART: C:\Users\User\AppData\Roaming\MetaQuotes\Terminal\Common\Files\EURUSDPyTren.py
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\MetaQuotes\Terminal\Common\Files\EURUSDPyTren.py", line 3, in <module>
import tensorflow as tf
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
>>>
Upgrade tensorflow to the latest version
pip install tensorflow==2.4.1
https://pypi.org/project/tensorflow/
Also switch to cuDNN 5.1
https://github.com/tensorflow/tensorflow/issues/7705

Tensor flow failing to load on ubuntu 18.04

A piece of code runs on my local machine but throws the following error when running on a remote server. How do I identify the cause of the problem?
Have not encountered such problems before so want to know how to proceed to debug such errors.
Starting the execution.. Using TensorFlow backend. Traceback (most recent call last): File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import * File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper() File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file) File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec) ImportError: /lib64/libm.so.6: version `GLIBC_2.23' not found (required by /home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "main.py", line 14, in <module>
from network import * File "/home/biplavc/data/AoI/UAV_Age/network.py", line 11, in <module>
from utils import * File "/home/biplavc/data/AoI/UAV_Age/utils.py", line 2, in <module>
from keras.losses import mean_squared_error File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/__init__.py", line 3, in <module>
from . import utils File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/backend/__init__.py", line 89, in <module>
from .tensorflow_backend import * File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg) ImportError: Traceback (most recent call last): File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import * File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper() File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file) File "/home/biplavc/anaconda3/envs/ML/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec) ImportError: /lib64/libm.so.6: version `GLIBC_2.23' not found (required by /home/biplavc/anaconda3/envs/ML/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

when import tensorflow is pressed it shows the following errors

when import tensorflow is pressed it shows the following errors i have the version 1.5.0 of tensorflow and i installed it through "python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.5.0-py3-none-any.whl" bcz ntg other command worked to install tensorflow
Traceback (most recent call last):
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\riya\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
import tensorflow issue has been resolved by changing python from 32 bit to 64 bit and python version must be 3.5-3.7 because 3.8 is not compatible for installing tensorflow through pip install tensorflow==1.5.0.

How can I get tensorflow to work on eclipse?

I am a student in high school trying to get tensor flow to work but when asking my teacher for assistance I get yelled at and told to just try harder. I have no clue what to do.
I want to use tensor flow on eclipse using python 3.7 and tensor flow 0.12.0
Tensorflow is in the library and installed through pip, but when trying to import it, it throws an error.
import tensorflow as tf
Traceback (most recent call last): File
"\cslab-server\home\CollinsC\Application
Data\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(file)]) File "C:\Program Files
(x86)\Python3.7-32\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python__init__.py", line 54, in
from tensorflow.python import pywrap_tensorflow
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in
_pywrap_tensorflow = swig_import_helper()
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\CSLAB-SERVER\home\CollinsC\My Documents\ISMWorkspace\ISMMMM\src\tensorflowtesting.py", line 6, in
import tensorflow as tf
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow__init__.py", line 24, in
from tensorflow.python import *
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python__init__.py", line 60, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(file)])
File "C:\Program Files (x86)\Python3.7-32\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python__init__.py", line 54, in
from tensorflow.python import pywrap_tensorflow
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in
_pywrap_tensorflow = swig_import_helper()
File "\cslab-server\home\CollinsC\Application Data\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named '_pywrap_tensorflow'
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.

I have installed tensorflow but still facing error on importing tensorflow

I'm using Python 3.7.3 on PyCharm IDE and did a pip install of of Tensorflow using command prompt(since install from IDE didn't work)as below
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.13.1-py3-none-any.whl
Tensorflow got installed successfully and is showing in my IDE interpreter
Now, when a run a code that just has "import tensorflow" I'm getting Falied to load native tensor flow runtime error
Error message:
E:\ImageClassification\venv\Scripts\python.exe C:/Users/User/.PyCharmCE2019.1/config/scratches/scratch_2.py
Traceback (most recent call last):
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "E:\Python\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/User/.PyCharmCE2019.1/config/scratches/scratch_2.py", line 1, in <module>
import tensorflow
File "E:\Python\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "E:\Python\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "E:\Python\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "E:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Process finished with exit code 1
pip install --upgrade tensorflow
or
you can uninstall the tensorflow and re-install it.