Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get attribute 'FeatureLoss' on <module '__main__' (built-in)> #3

Open
applech666 opened this issue Dec 31, 2020 · 3 comments
Open

Comments

@applech666
Copy link

Thank you very much for your resources. In Linux environment, Uwsgi deployment, error still occurs:
** Starting uWSGI 2.0.19.1 (64bit) on [Thu Dec 31 18:07:43 2020] ***
compiled with version: 5.4.0 20160609 on 17 December 2020 08:16:00
os: Linux-4.4.0-198-generic #230-Ubuntu SMP Sat Nov 28 01:30:29 UTC 2020
nodename: 10-9-60-142
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /home/ubuntu/chengping/artline-demo-main
writing pidfile to uwsgi.pid
detected binary path: /home/ubuntu/songcheng/venv3.0/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /home/ubuntu/chengping/artline-demo-main/
your processes number limit is 63944
your memory page size is 4096 bytes
detected max file descriptor number: 1000000
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 0.0.0.0:5000 fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.7.1 (default, Dec 17 2020, 15:23:31) [GCC 5.4.0 20160609]
Set PythonHome to /home/ubuntu/songcheng/venv3.0/
Python main interpreter initialized at 0xc51680
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145840 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 14225)
spawned uWSGI worker 1 (pid: 14226, cores: 1)
*** Stats server enabled on 0.0.0.0:8383 fd: 9 ***
Traceback (most recent call last):
File "./app_cpu.py", line 76, in
state = torch.load('ArtLine_650.pkl', map_location='cpu') if defaults.device == torch.device('cpu') else torch.load(source)
File "/home/ubuntu/venv3.0/lib/python3.7/site-packages/torch/serialization.py", line 584, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/home/ubuntu/venv3.0/lib/python3.7/site-packages/torch/serialization.py", line 842, in _load
result = unpickler.load()
AttributeError: Can't get attribute 'FeatureLoss' on <module 'main' (built-in)>
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

but, In the same situation, I can run my service in Python.

@jwenjian
Copy link
Owner

jwenjian commented Jan 1, 2021

Actually, I faced that issue too :(

I googled a lot and find no solution, so let's keep this issue opened and continue to research.

Happy new year!

@squallsdjl
Copy link

Same issue. Wait for a update :)

@ez4lgd
Copy link

ez4lgd commented Dec 16, 2022

Same too. Wait for a update :)
When I start by DJango,python manage.py runserver, it's ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants