-
To kill celery task workers, use:
ps -ef | grep [YOUR_WORKER_NAME] | awk '{ print $2 }' | xargs kill -9
Do NOT
grep celery
or you may kill other tasks' workers.By default, celery uses prefork worker pool, which is incompatible with pytorch non-forkable lib. So we switch to thread-based gevent pool. To install gevent:
conda install gevent
-
Put detection_state_dict.pth and score_state_dict.pth to data/.
If model was trained with DataParallel, you may need to re-save state_dict withextract_state_dict.ipynb
. -
Prepare celery-config.py and config.py.
celery-config.py:broker_url = 'redis://:[REDIS_PASSWORD]@r-wz9j4vwobcb81ws9mapd.redis.rds.aliyuncs.com:6379/0' result_backend = 'redis://:[REDIS_PASSWORD]@r-wz9j4vwobcb81ws9mapd.redis.rds.aliyuncs.com:6379/0' device_name = 'cpu' # or 'cuda:0' if you want to use gpu
config.py:
access_key_id = 'xxxxx' access_key_secret = 'yyyyy'
-
start celery worker:
celery -A root-worker worker --pool gevent --concurrency 1 --time-limit 60
or with nohup:
nohup celery -A root-worker worker --pool gevent --concurrency 1 --time-limit 60 > worker.log &
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Orientsoft/root-server
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published