I am following the "Serving Inception Model with TensorFlow Serving and Kubernetes" tutorial from the tensorflow.org website. When I get to loading and exporting the model using
root#ecf82ac60c6b:/serving# bazel-bin/tensorflow_serving/example/inception_saved_model --checkpoint_dir=inception-v3 --output_dir=/tmp/inception-export
I get following error.
Traceback (most recent call last):
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/tf_serving/tensorflow_serving/example/inception_saved_model.py", line 202, in <module>
tf.app.run()
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/tf_serving/tensorflow_serving/example/inception_saved_model.py", line 198, in main
export()
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/tf_serving/tensorflow_serving/example/inception_saved_model.py", line 91, in export
table = tf.contrib.lookup.index_to_string_table_from_tensor(class_tensor)
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/python/util/lazy_loader.py", line 53, in __getattr__
module = self._load()
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/python/util/lazy_loader.py", line 42, in _load
module = importlib.import_module(self.__name__)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/contrib/__init__.py", line 82, in <module>
from tensorflow.contrib.eager.python import tfe as eager
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/contrib/eager/python/tfe.py", line 76, in <module>
from tensorflow.contrib.eager.python.datasets import Iterator
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/contrib/eager/python/datasets.py", line 23, in <module>
from tensorflow.contrib.data.python.ops import prefetching_ops
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/prefetching_ops.py", line 25, in <module>
resource_loader.get_path_to_datafile("../../_prefetching_ops.so"))
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/contrib/util/loader.py", line 55, in load_op_library
ret = load_library.load_op_library(path)
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/python/framework/load_library.py", line 56, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename, status)
File "/serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /serving/bazel-bin/tensorflow_serving/example/inception_saved_model.runfiles/org_tensorflow/tensorflow/contrib/data/python/ops/../../_prefetching_ops.so: undefined symbol: _ZN6google8protobuf8internal9ArenaImpl10AddCleanupEPvPFvS3_E
I tried the solution on How to troubleshoot deployment of Inception serving running in kubernetes, but it does not apply to this problem. Has anyone encountered the same problem and maybe figured out how to solve it?
Related
I want to use a numpy function in an Anki addon that I am forking, but it returns an error when I run Anki (error below). I guess it is because I am using import numpy. So how I can use a numpy function when the package is not in the original code in the addon. Should I install the package first? If yes, how? Because pip install doesn't work in the code and I should probably install package in an environment.
Caught exception:
Traceback (most recent call last):
File "aqt\progress.py", line 54, in handler
File "aqt\main.py", line 149, in on_window_init
File "aqt\main.py", line 197, in setupProfileAfterWebviewsLoaded
File "aqt\main.py", line 244, in setupProfile
File "aqt\main.py", line 425, in loadProfile
File "aqt\hooks_gen.py", line 2985, in __call__
File "anki\hooks.py", line 34, in runHook
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\__init__.py", line 37, in start_here
from . import common as fastwq
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\common.py", line 29, in <module>
from .gui import show_about_dialog, show_options # , check_updates
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\gui\__init__.py", line 3, in <module>
from .common import *
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\gui\common.py", line 28, in <module>
from ..service import service_manager, service_pool
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\service\__init__.py", line 24, in <module>
service_manager = ServiceManager() # Service Manager
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\service\manager.py", line 35, in __init__
self.update_services()
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\service\manager.py", line 43, in update_services
self.web_services, self.local_custom_services = self._get_services_from_files()
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\service\manager.py", line 78, in _get_services_from_files
module = importlib.import_module(
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\utils\importlib.py", line 43, in import_module
__import__(name)
File "C:\Users\saeed\AppData\Roaming\Anki2\addons21\1807206748\service\dict\frdic.py", line 8, in <module>
import numpy
ModuleNotFoundError: No module named 'numpy'
When I try to run, I keep getting this error. I've tried downgrading to pyobjc 7.3 and it still gives me the same error. What could be the problem?
Traceback (most recent call last):
File "/Users/jeremyparker/PycharmProjects/pythonProject/main.py", line 4, in <module>
import pynput
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynput/__init__.py", line 40, in <module>
from . import keyboard
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynput/keyboard/__init__.py", line 31, in <module>
backend = backend(__name__)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynput/_util/__init__.py", line 70, in backend
return importlib.import_module('._' + module, package)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynput/keyboard/_darwin.py", line 51, in <module>
from pynput._util.darwin import (
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pynput/_util/darwin.py", line 60, in <module>
OBJC.PyObjCObject_New.restype = ctypes.py_object
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 387, in __getattr__
func = self.__getitem__(name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 392, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x2055dbc80, PyObjCObject_New): symbol not found
I get a 500 Server Error while uploading my app on GAE. It works perfectly fine locally with dev_appserver with SETTINGS_MODE='prod'.
Based on the logs, it cannot find MySQLdb on GAE. It does not make sense to me.
Help!
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 266, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/core/handlers/wsgi.py", line 236, in __call__
self.load_middleware()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/core/handlers/base.py", line 49, in load_middleware
mod = import_module(mw_module)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/contrib/auth/middleware.py", line 3, in <module>
from django.contrib.auth.backends import RemoteUserBackend
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/contrib/auth/backends.py", line 3, in <module>
from django.contrib.auth.models import Permission
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/contrib/auth/models.py", line 8, in <module>
from django.db import models
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/db/utils.py", line 93, in __getitem__
backend = load_backend(db['ENGINE'])
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/db/utils.py", line 27, in load_backend
return import_module('.base', backend_name)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.5/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
The answer is fairly simple. Add the following lines in the app.yaml file:
libraries:
- name: MySQLdb
version: "latest"
Details can be found on the page
https://cloud.google.com/appengine/docs/python/cloud-sql
I am trying to setup a django-dash demo via: https://github.com/barseghyanartur/django-dash.
I have manually installed all the dependencies for django-dash (because of work computer/proxy issues) and supposedly successfully installed django-dash as well. Following the tutorial, I went to add several layouts and plugins to the INSTALLED_APPS settings for my app. There are no issues when I add all of the plugins except for the ones in asterisks - memo and news.
INSTALLED_APPS = (
# ...
'dash',
'dash.contrib.layouts.android',
'dash.contrib.layouts.bootstrap2',
'dash.contrib.layouts.windows8',
'dash.contrib.plugins.dummy',
'dash.contrib.plugins.image',
**'dash.contrib.plugins.memo',
'dash.contrib.plugins.news',**
'dash.contrib.plugins.rss_feed',
'dash.contrib.plugins.url',
'dash.contrib.plugins.video',
'dash.contrib.plugins.weather',
# ...
)
This is the error message I get. I thought maybe files were missing but when I check the folders, autoreload.py etc are all there. What might be the issue?
Unhandled exception in thread started by <function wrapper at 0x0208ECB0>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 93, in w
rapper
fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.
py", line 101, in inner_run
self.validate(display_num_errors=True)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 310,
in validate
num_errors = get_validation_errors(s, app)
File "C:\Python27\lib\site-packages\django\core\management\validation.py", lin
e 34, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 196, in
get_app_errors
self._populate()
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 75, in
_populate
self.load_app(app_name, True)
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 99, in
load_app
models = import_module('%s.models' % app_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in im
port_module
__import__(name)
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\models.py
", line 21, in <module>
class DashboardSettings(models.Model):
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\models.py
", line 32, in DashboardSettings
layout_uid = models.CharField(_("Layout"), max_length=25, choices=get_regist
ered_layouts())
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\base.py",
line 1491, in get_registered_layouts
ensure_autodiscover()
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\base.py",
line 1432, in ensure_autodiscover
autodiscover()
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\discover.
py", line 33, in autodiscover
do_discover(PLUGINS_MODULE_NAME)
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\discover.
py", line 27, in do_discover
__import__('{0}.{1}'.format(app, module_name))
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\contrib\p
lugins\memo\dash_plugins.py", line 10, in <module>
from dash.contrib.plugins.memo.forms import MemoForm, TinyMCEMemoForm
File "C:\Python27\lib\site-packages\django_dash-0.4.5-py2.7.egg\dash\contrib\p
lugins\memo\forms.py", line 9, in <module>
from tinymce.widgets import TinyMCE
File "C:\Python27\lib\site-packages\django_tinymce-1.5.2-py2.7.egg\tinymce\wid
gets.py", line 10, in <module>
import tinymce.settings
File "C:\Python27\lib\site-packages\django_tinymce-1.5.2-py2.7.egg\tinymce\set
tings.py", line 16, in <module>
JS_ROOT = getattr(settings, 'TINYMCE_JS_ROOT',os.path.join(settings.STATIC_R
OOT, 'tiny_mce'))
File "C:\Python27\lib\ntpath.py", line 64, in join
result_drive, result_path = splitdrive(path)
File "C:\Python27\lib\ntpath.py", line 94, in splitdrive
if p[1:2] == ':':
TypeError: 'NoneType' object has no attribute '__getitem__'
As documented (recently), django-tinymce package is required for news and memo plugins.
https://github.com/barseghyanartur/django-dash/tree/master/src/dash/contrib/plugins/news
https://github.com/barseghyanartur/django-dash/tree/master/src/dash/contrib/plugins/memo
Unfortunately, django-tinymce is not yet compatible with Python 3 (there is, however, a python 3 compatible branch which is aimed to become master one day).
In case you're using Python 3, you should simply use TinyMCE without django-tinymce (which isn't much work anyway).
I have migrated django website from live server to my localhost, i took the backup of posrgresql database and attached to my localhost i have changed the databse connection details in the live_setting.py and also installed the required packages which were already installed on the live server but i am unable to run the website on my localhost when i use manage.py ruserver command i got the following errors.
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x02BB6530>>
Traceback (most recent call last):
File "C:\Python26\lib\site-packages\django\core\management\commands\runserver.py", line 91, in inner_run self.validate(display_num_errors=True)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 266,in validate num_errors = get_validation_errors(s, app)
File "C:\Python26\lib\site-packages\django\core\management\validation.py", line 30, in get_validation_errors for (app_name, error) in get_app_errors().items():
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 158, inget_app_errors self._populate()
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 67, in_populate self.load_app(app_name)
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 88, in load_app models = import_module('.models', app_name)
File "C:\Python26\lib\site-packages\django\utils\importlib.py", line 35, in import_module__import__(name)
File "C:\Python26\lib\site-packages\django_social_auth3-0.7.20-py2.6.egg\social_auth\models.py", line 8, in <module>'social_auth.db.django_models'))
File "C:\Python26\lib\site-packages\django\utils\importlib.py", line 35, in import_module__import__(name)
File "C:\Python26\lib\site-packages\django_social_auth3-0.7.20-py2.6.egg\social_auth\db\django_models.py", line 5, in <module>from social_auth.db.base import UserSocialAuthMixin, AssociationMixin, \
File "C:\Python26\lib\site-packages\django_social_auth3-0.7.20-py2.6.egg\social_auth\db\base.py", line 7, in <module> from openid.association import Association as OIDAssociation
File "build\bdist.win32\egg\openid\association.py", line 37, in <module>
File "build\bdist.win32\egg\openid\cryptutil.py", line 33, in <module>
File "build\bdist.win32\egg\openid\oidutil.py", line 16, in <module> ImportError: No module named parse
I am using python 2.6 and django 1.4.3, how can i solve these errors, i am new to python/django development.