When i run my project in my system it was running fine, but when i made it as nvidia-docker2 container and run it i am getting the following error :
I ensured my pytorch version, cuda version are almost same in both the environments, whereas python version differs , 3.10 in my system, 3.8 in the docker container
Docker container Details :
➜ Face-Recognition-From-Crowd ⚡ 3 hours ago ( master)▶ sudo docker run --gpus all --device /dev/video0 --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -it face-crowd bash
=============
== PyTorch ==
=============
NVIDIA Release 22.11 (build 48503342)
PyTorch Version 1.13.0a0+936e930
Container image Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (c) 2014-2022 Facebook Inc.
Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)
Copyright (c) 2011-2013 NYU (Clement Farabet)
Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)
Copyright (c) 2006 Idiap Research Institute (Samy Bengio)
Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)
Copyright (c) 2015 Google Inc.
Copyright (c) 2015 Yangqing Jia
Copyright (c) 2013-2016 The Caffe contributors
All rights reserved.
Various files include modifications (c) NVIDIA CORPORATION & AFFILIATES. All rights reserved.
This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
root#a08973389041:/app# python3 run.py --source live
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2548, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2528, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/app/app.py", line 57, in video_feed
video = Process(os.path.abspath('./temp'),
File "/app/process.py", line 45, in __init__
self.recognizer = Predictor(file=False, label=True)
File "/app/scripts/FaceRecognition.py", line 31, in __init__
self.model = SingleShotLearningFR(pretrained=True)
File "/app/scripts/FRMethods/SingleShotLearningFR.py", line 29, in __init__
super(SingleShotLearningFR, self).__init__()
File "/usr/local/lib/python3.8/dist-packages/pytorch_lightning/core/module.py", line 124, in __init__
self._register_sharded_tensor_state_dict_hooks_if_available()
File "/usr/local/lib/python3.8/dist-packages/pytorch_lightning/core/module.py", line 2022, in _register_sharded_tensor_state_dict_hooks_if_available
self.__class__._register_load_state_dict_pre_hook(
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1467, in _register_load_state_dict_pre_hook
self._load_state_dict_pre_hooks[handle.id] = _WrappedHook(hook, self if with_module else None)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 54, in __init__
self.module: weakref.ReferenceType["Module"] = weakref.ref(module)
TypeError: cannot create weak reference to 'weakcallableproxy' object
Note : Ask me the details u need, i will add it as edit.
Also mention the possibility of mistakes that causes this error
I had similar problem, getting the same error message. The workaround which worked for me is to downgrade pytorch-lightning pip package from 1.9.0 to 1.8.6.
Bug is caused by using pytorch package that was compiled from a specific commit, which breaks version comparison code (1.13.0a0+d0d6b1f >= 1.13 does not hold in my case) as described in PL issue.
The issue points out another (preferred) workaround - to use stable version of pytorch or wait till fix is released.
Related
I'm following a tutorial trying to host Django on apache server, now as I finally installed mod_wsgi using cmd, I try to use the command:
mod_wsgi-express module-config
now i get another bugging error - which is:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
(Adwy) C:\Users\Adwy>mod_wsgi-express module-config
Traceback (most recent call last):
File "C:\Users\Adwy\AppData\Local\Programs\Python\Python35\Scripts\mod_wsgi-express-script.py", line 11, in <module>
load_entry_point('mod-wsgi==4.5.20', 'console_scripts', 'mod_wsgi-express')()
File "c:\users\adwy\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\users\adwy\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 2859, in load_entry_point
return ep.load()
File "c:\users\adwy\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 2450, in load
return self.resolve()
File "c:\users\adwy\appdata\local\programs\python\python35\lib\site-packages\pkg_resources\__init__.py", line 2456, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "c:\users\adwy\appdata\local\programs\python\python35\lib\site-packages\mod_wsgi\server\__init__.py", line 24, in <module>
from . import apxs_config
File "c:\users\adwy\appdata\local\programs\python\python35\lib\site-packages\mod_wsgi\server\apxs_config.py", line 27
LIBEXECDIR = 'C:\xampp\apache\/lib'
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-4: truncated \xXX escape
I'm looking for help!
thanks,
Looks like you might need to set the MOD_WSGI_APACHE_ROOTDIR environment variable with forward slashes.
example:
"C:/foo/bar/apache"
To apply this changes you need to reinstall mod_wsgi:
pip uninstall mod_wsgi
pip install mod_wsgi
Looks like you might need to set the MOD_WSGI_APACHE_ROOTDIR environment variable with forward slashes. example: "C:/foo/bar/apache"
Take a look at this issue, which looks similar:
https://github.com/GrahamDumpleton/mod_wsgi/issues/345
Well this is strange. I'm running Azure Powershell 5.0.1 in my Azure account and attempting to create an App Service Plan to support this tutorial; the step
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku FREE
The error message below references the 'pscloudshell' file (which I've confirmed doesn't exist on my Azure account).
I've tried
- verifying that the file exists (it doesn't)
- a web search on the string 'pscloudshell' and 'FileNotFoundError: [WinError 3] pscloudshell' (but it's pretty sparse) and
a search on Stackoverflow on string 'pscloudshell' to find 'Your search returned no matches.'. I must be the first to experience this?!
The error of which I speak is
PS Azure:\> az appservice plan create --name myAppServicePlan2 --resource-group myResourceGroup2 --sku FREE
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\__main__.py", line 23, in <module>
exit_code = azure.cli.main.main(args)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\main.py", line 28, in main
os.makedirs(azure_folder)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\os.py", line 210, in makedirs
makedirs(head, mode, exist_ok)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\os.py", line 220, in makedirs
mkdir(name, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\ContainerAdministrator\\CloudDrive\\.pscloudshell'
az -v give:
azure-cli (2.0.22)
acr (2.0.16)
acs (2.0.21)
advisor (0.1.0)
appservice (0.1.21)
backup (1.0.3)
batch (3.1.7)
batchai (0.1.3)
billing (0.1.6)
cdn (0.0.10)
cloud (2.0.10)
cognitiveservices (0.1.9)
command-modules-nspkg (2.0.1)
configure (2.0.12)
consumption (0.2.0)
container (0.1.14)
core (2.0.22)
cosmosdb (0.1.15)
dla (0.0.15)
dls (0.0.18)
eventgrid (0.1.5)
extension (0.0.6)
feedback (2.0.6)
find (0.2.7)
interactive (0.3.11)
iot (0.1.14)
keyvault (2.0.14)
lab (0.0.13)
monitor (0.0.13)
network (2.0.18)
nspkg (3.0.1)
profile (2.0.15)
rdbms (0.0.9)
redis (0.2.10)
reservations (0.1.0)
resource (2.0.19)
role (2.0.15)
servicefabric (0.0.6)
sql (2.0.16)
storage (2.0.20)
vm (2.0.19)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\ContainerAdministrator\CloudDrive\.pscloudshell\.azure\cliextensions'
Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
I've tried - verifying that the file exists (it doesn't)
I reproduce your error with an old cloud shell, I can't find .pscloudshell in that directory.
Then I delete it from Azure resource group and create a new cloud shell, it works fine:
PS C:\Users\ContainerAdministrator\CloudDrive> pwd
Path
----
C:\Users\ContainerAdministrator\CloudDrive
PS C:\Users\ContainerAdministrator\CloudDrive> ls
Directory: C:\Users\ContainerAdministrator\CloudDrive
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/13/2017 4:30 AM .pscloudshell
It seems there are some updates with Azure cloud shell, please delete your original cloud shell and re-create a new one.
You are trying to run Azure CLI command in PowerShell console of Cloud shell, instead You Should run Azure CLI commands in Bash Shell of cloud shell.
I am trying to analyze Wikipedia dump file. I am using gensim.scripts, a Python library, and running this command in Windows 10 cmd.exe:
python -m gensim.scripts.make_wiki enwiki-latest-pages-articles.xml.bz2 wiki_en_output
This gives me the error:Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
2015-12-03 15:47:20,459 : INFO : running C:\Python27\lib\site-packages\gensim-0.12.3-py2.7-win32.egg\gensim\scripts\make_wiki.py enwiki-latest-pages-articles.xml.bz2 wiki_en_output
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\gensim-0.12.3-py2.7-win32.egg\gensim\scripts\make_wiki.py", line 84, in <module>
wiki = WikiCorpus(inp, lemmatize=lemmatize) # takes about 9h on a macbook pro, for 3.5m articles (june 2011)
File "C:\Python27\lib\site-packages\gensim-0.12.3-py2.7-win32.egg\gensim\corpora\wikicorpus.py", line 270, in __init__
self.dictionary = Dictionary(self.get_texts())
File "C:\Python27\lib\site-packages\gensim-0.12.3-py2.7-win32.egg\gensim\corpora\dictionary.py", line 58, in __init__
self.add_documents(documents, prune_at=prune_at)
File "C:\Python27\lib\site-packages\gensim-0.12.3-py2.7-win32.egg\gensim\corpora\dictionary.py", line 119, in add_documents
for docno, document in enumerate(documents):
File "C:\Python27\lib\site-packages\gensim-0.12.3-py2.7-win32.egg\gensim\corpora\wikicorpus.py", line 290, in get_texts
texts = ((text, self.lemmatize, title, pageid) for title, text, pageid in extract_pages(bz2.BZ2File(self.fname), self.filter_namespaces))
IOError: [Errno 2] No such file or directory: 'enwiki-latest-pages-articles.xml.bz2'
Thoughts on what I should do to fix this?
On Windows 10. gensim.scripts has been installed.
Just put the whole path to the downloaded enwiki-latest-pages-articles.xml.bz2, or try to run gensim script from the download folder.
If you haven't that archive - you may find and download it from dumps wikimedia website
I am currently running python 2.7 and am attempting to install Pyglet module with AVBin. It seems to be working fine for graphics and other things that do not require AVBin but everything else has errors.
This the error that i am recieving.
Microsoft Windows XP [Version 6.1.7601]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Users\Brian\Documents\Python>media.py
Traceback (most recent call last):
File "C:\Users\Brian\Documents\Python\media.py", line 3, in <module>
sound = pyglet.media.load('music.mp3')
File "C:\Python27\lib\site-packages\pyglet\media\__init__.py", line 1406, in l
oad
source = get_source_loader().load(filename, file)
File "C:\Python27\lib\site-packages\pyglet\media\__init__.py", line 1382, in l
oad
return avbin.AVbinSource(filename, file)
File "C:\Python27\lib\site-packages\pyglet\media\avbin.py", line 268, in __ini
t__
av.avbin_stream_info(self._file, i, info)
File "C:\Python27\lib\site-packages\pyglet\media\avbin.py", line 198, in f
result = func(*args)
WindowsError: exception: integer divide by zero
The python script file has been executed from a windows command prompt. I am new to Python and so have limited knowledge of it's workings. I am running 64bit windows 7 with 64bit beta version of pyglet and 64bit version of AVBin.
Thanks,
Brian
It was probably cause by this bug that was fixed in AVbin 11 alpha 4.
It appears as though the AVBin module is clashing with the Pyglet module and attempting to divide by zero.
The only way I can think of solving this is by using something other than AVBin to install
When trying to run a python script, I get the error AttributeError: 'module' object has no attribute 'pydebug'. I am using Python 2.6.
Full error:
File "/lib/python2.6/distutils/sysconfig.py", line 238, in get_makefile_filename
return os.path.join(lib_dir, "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'
I hit this issue when attempting to run the Ubuntu 12.04.1 system gdb on a python I built myself. I expect Ubuntu has built some hooks into the system gdb so that it uses a debugging version of Python; but the hooks don't latch onto anything in my own python. I got around this by building my own gdb and running that instead.
Here's the command-line and full traceback:
price#neverland:~/LSST/ip_diffim[master] $ gdb --args python tests/SnapPsfMatch.py
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 337, in _init_posix
makefile = _get_makefile_filename()
File "/usr/lib/python2.7/sysconfig.py", line 331, in _get_makefile_filename
return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'
so it seems to go looking for the wrong python (in /usr/lib) despite my having told the system not to do so:
price#neverland:~/LSST/ip_diffim[master] $ which python
/home/price/eups/Linux/python/2.7.2/bin/python
price#neverland:~/LSST/ip_diffim[master] $ echo $PYTHONPATH | grep usr
price#neverland:~/LSST/ip_diffim[master] $
I receive the error when running gdb on a Ubuntu system where an alternative version of Python has been installed and is being preferred by the linker. You can verify whether this is happening in your case by using ldd to ask which libraries gdb is using:
# ldd $(which gdb)
...
libpython2.7.so.1.0 => /usr/local/lib/libpython2.7.so.1.0 (0x00007ff75e044000)
...
You can see that the off-brand version of Python running in /usr/local/lib is supplying libpython to gdb instead of the official Ubuntu Python in /usr/lib which is causing the error — whatever off-brand Python this is in /usr/local must not have been compiled in the same way that the Ubuntu Python was compiled, and so the expectations of gdb are being disappointed.
The solution is to use the environment to control the linker’s behavior and make it prefer the system libpython. For good measure, I also reset my PATH back to something utterly standard. I find that this works:
PATH=/bin:/usr/bin LD_LIBRARY_PATH=/usr/lib gdb ...
I think whatever you are trying to run is expecting to be used with a special debug build of python. sys.pydebug is not normally found on the standard release of the sys module, and I believe it would be there if you built a debug python:
http://docs.python.org/c-api/intro.html#debugging-builds
It is possible that this also might be part of a specific build that Debian/Ubuntu distros are using.
On Ubunut-12.04 pyinstaller built binaries invoke "site.py" from host python installation the call trace is trying to fetch "sys.pydebug" value.
$ python
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import sys
>>> sys.pydebug
False
The custom built python is missing this.
HACK: To make pyinstaller binaries work on Ubuntu-12.04.
Added below code change in custom built python which return zero for "sys.pydebug".
$ diff -Naur Python/sysmodule-org.c Python/sysmodule.c
--- Python/sysmodule-org.c 2018-03-15 09:37:26.539515000 -0700
+++ Python/sysmodule.c 2018-03-15 19:58:34.503031000 -0700
## -1106,6 +1106,7 ##
maxunicode -- the largest supported character\n\
builtin_module_names -- tuple of module names built into this
interpreter\n\
version -- the version of this interpreter as a string\n\
+pydebug -- always return zero\n\
version_info -- version information as a named tuple\n\
hexversion -- version information encoded as a single integer\n\
copyright -- copyright notice pertaining to this interpreter\n\
## -1420,6 +1421,8 ##
SET_SYS_FROM_STRING("version",
PyString_FromString(Py_GetVersion()));
+ SET_SYS_FROM_STRING("pydebug",
+ PyInt_FromLong(0));
SET_SYS_FROM_STRING("hexversion",
PyInt_FromLong(PY_VERSION_HEX));
svnversion_init();