From 0bafaf6e1da26c5d1ad0e8f5f2d516f468e9e6e2 Mon Sep 17 00:00:00 2001 From: wudong Date: Tue, 29 Nov 2022 16:14:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E6=96=AD=E8=AE=AD=E7=BB=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 602 +++++++-------- app/configs/default.py | 58 +- app/configs/development.py | 16 +- app/configs/global_var.py | 80 +- app/configs/production.py | 6 +- app/configs/testing.py | 28 +- app/controller/AlgorithmController.py | 972 ++++++++++++------------- app/controller/WebStatusController.py | 66 +- app/controller/__init__.py | 8 +- app/controller/圆孔_123_RODY_1_640.zip | Bin 57090413 -> 49923072 bytes app/yolov5/data/coco128.yaml | 8 +- nohup.out | 503 ++++++++++++- train_log.txt | 27 + 13 files changed, 1418 insertions(+), 956 deletions(-) create mode 100644 train_log.txt diff --git a/.gitignore b/.gitignore index 0c69304..580f211 100644 --- a/.gitignore +++ b/.gitignore @@ -1,301 +1,301 @@ -### Python template -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -### IntelliJ IDEA ### -.idea/ -*.iws -*.iml -*.ipr - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# spec -manage.spec - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ - -# Translations -*.mo -*.pot - -# Django stuff: -staticfiles/ - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# pyenv -.python-version - - - -# Environments -.venv -venv/ -ENV/ -.vscode - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - - -### Node template -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - - -### Linux template -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - - -### VisualStudioCode template -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - - - - - -### Windows template -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### macOS template -# General -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### SublimeText template -# Cache files for Sublime Text -*.tmlanguage.cache -*.tmPreferences.cache -*.stTheme.cache - -# Workspace files are user-specific -*.sublime-workspace - -# Project files should be checked into the repository, unless a significant -# proportion of contributors will probably not be using Sublime Text -# *.sublime-project - -# SFTP configuration file -sftp-config.json - -# Package control specific files -Package Control.last-run -Package Control.ca-list -Package Control.ca-bundle -Package Control.system-ca-bundle -Package Control.cache/ -Package Control.ca-certs/ -Package Control.merged-ca-bundle -Package Control.user-ca-bundle -oscrypto-ca-bundle.crt -bh_unicode_properties.cache - -# Sublime-github package stores a github token in this file -# https://packagecontrol.io/packages/sublime-github -GitHub.sublime-settings - - -### Vim template -# Swap -[._]*.s[a-v][a-z] -[._]*.sw[a-p] -[._]s[a-v][a-z] -[._]sw[a-p] - -# Session -Session.vim - -# Temporary -.netrwhist - -# Auto-generated tag files -tags - - -### VirtualEnv template -# Virtualenv -[Bb]in -[Ii]nclude -[Ll]ib -[Ll]ib64 -[Ss]cripts -pyvenv.cfg -pip-selfcheck.json -.env - - -### Project template - -izan/media/ - -.pytest_cache/ - -!app/yolov5/yolov5s.pt -*.pt -*.pdparams -*.onnx - - +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +### IntelliJ IDEA ### +.idea/ +*.iws +*.iml +*.ipr + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# spec +manage.spec + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +staticfiles/ + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# pyenv +.python-version + + + +# Environments +.venv +venv/ +ENV/ +.vscode + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + + +### Node template +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + + +### Linux template +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + + +### VisualStudioCode template +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + + + + + +### Windows template +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +### macOS template +# General +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### SublimeText template +# Cache files for Sublime Text +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache + +# Workspace files are user-specific +*.sublime-workspace + +# Project files should be checked into the repository, unless a significant +# proportion of contributors will probably not be using Sublime Text +# *.sublime-project + +# SFTP configuration file +sftp-config.json + +# Package control specific files +Package Control.last-run +Package Control.ca-list +Package Control.ca-bundle +Package Control.system-ca-bundle +Package Control.cache/ +Package Control.ca-certs/ +Package Control.merged-ca-bundle +Package Control.user-ca-bundle +oscrypto-ca-bundle.crt +bh_unicode_properties.cache + +# Sublime-github package stores a github token in this file +# https://packagecontrol.io/packages/sublime-github +GitHub.sublime-settings + + +### Vim template +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-v][a-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist + +# Auto-generated tag files +tags + + +### VirtualEnv template +# Virtualenv +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ss]cripts +pyvenv.cfg +pip-selfcheck.json +.env + + +### Project template + +izan/media/ + +.pytest_cache/ + +!app/yolov5/yolov5s.pt +*.pt +*.pdparams +*.onnx + + diff --git a/app/configs/default.py b/app/configs/default.py index 9b73cc4..5dd9f30 100644 --- a/app/configs/default.py +++ b/app/configs/default.py @@ -1,29 +1,29 @@ -import os - -# 根目录 -ROOT_PATH = os.path.split(os.path.abspath(__name__))[0] -# 开启debug -DEBUG = True -# 密钥 -SECRET_KEY = 'WugjsfiYBEVsiQfiSwEbIOEAGnOIFYqoOYHEIK' - -# 数据库配置 -SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://deepLearner:dp2021@124.71.203.3:5432/demo' -#SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://demo:demo123@192.168.2.9:3306/flask_demo' -SQLALCHEMY_TRACK_MODIFICATIONS = False -# 查询时会显示原始SQL语句 -SQLALCHEMY_ECHO = True - -# SQLALCHEMY_DATABASE_URI = 'sqlite:///{}'.format(os.path.join(ROOT_PATH, 'demo.db')) -# SQLALCHEMY_TRACK_MODIFICATIONS = False - -# 数据库配置 -db = { - 'host': '127.0.0.1', - 'user': 'root', - 'password': 'sdust2020', - 'port': 6379, - 'database': 'school', - 'charset': 'utf8', - 'db': 0 -} +import os + +# 根目录 +ROOT_PATH = os.path.split(os.path.abspath(__name__))[0] +# 开启debug +DEBUG = True +# 密钥 +SECRET_KEY = 'WugjsfiYBEVsiQfiSwEbIOEAGnOIFYqoOYHEIK' + +# 数据库配置 +SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://deepLearner:dp2021@124.71.203.3:5432/demo' +#SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://demo:demo123@192.168.2.9:3306/flask_demo' +SQLALCHEMY_TRACK_MODIFICATIONS = False +# 查询时会显示原始SQL语句 +SQLALCHEMY_ECHO = True + +# SQLALCHEMY_DATABASE_URI = 'sqlite:///{}'.format(os.path.join(ROOT_PATH, 'demo.db')) +# SQLALCHEMY_TRACK_MODIFICATIONS = False + +# 数据库配置 +db = { + 'host': '127.0.0.1', + 'user': 'root', + 'password': 'sdust2020', + 'port': 6379, + 'database': 'school', + 'charset': 'utf8', + 'db': 0 +} diff --git a/app/configs/development.py b/app/configs/development.py index 0cac850..cc9b776 100644 --- a/app/configs/development.py +++ b/app/configs/development.py @@ -1,8 +1,8 @@ -from .default import * # NOQA F401 - -# 数据库配置 -SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://demo:demo123@192.168.2.9:3306/flask_demo' -# SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://demo:demo123@192.168.2.9:3306/flask_demo?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai' -SQLALCHEMY_TRACK_MODIFICATIONS = False -# 查询时会显示原始SQL语句 -SQLALCHEMY_ECHO = True +from .default import * # NOQA F401 + +# 数据库配置 +SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://demo:demo123@192.168.2.9:3306/flask_demo' +# SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://demo:demo123@192.168.2.9:3306/flask_demo?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai' +SQLALCHEMY_TRACK_MODIFICATIONS = False +# 查询时会显示原始SQL语句 +SQLALCHEMY_ECHO = True diff --git a/app/configs/global_var.py b/app/configs/global_var.py index e64350a..c444450 100644 --- a/app/configs/global_var.py +++ b/app/configs/global_var.py @@ -1,36 +1,44 @@ -""" -@Time : 2022/11/15 10:13 -@Auth : 东 -@File :global_var.py -@IDE :PyCharm -@Motto:ABC(Always Be Coding) -@Desc: - -""" -import json -from app.utils.redis_config import redis_client - - -def _init(): # 初始化 - dict = {} - redis_client.__setattr__("_global_dict", json.dumps(dict)) - - -def set_value(key, value): - # 定义一个全局变量 - dict = redis_client.get_redis().get("_global_dict") - if dict is None: - dict = {} - dict[key] = value - # redis_client.get_redis().set("_global_dict", json.dumps(dict)) - redis_client.__setattr__("_global_dict", json.dumps(dict)) - - - -def get_value(key): - # 获得一个全局变量,不存在则提示读取对应变量失败 - try: - return redis_client.get_redis().get("_global_dict")[key] - except Exception as e: - print(e) - print('读取' + key + '失败\r\n') +""" +@Time : 2022/11/15 10:13 +@Auth : 东 +@File :global_var.py +@IDE :PyCharm +@Motto:ABC(Always Be Coding) +@Desc: + +""" +import multiprocessing + + + +def _init(): # 初始化 + # 中断标志 + global _global_dict + _global_dict = {} + +# # ws列表存储 +# global _active_connections +# _active_connections = multiprocessing.Manager().list() + +# # ws字典存储 +# global _active_connections_dist +# _active_connections_dist = multiprocessing.Manager().dict() + + +# def get_active_connections(): +# return _active_connections + +# def get_active_connections_dist(): +# return _active_connections_dist + +def set_value(key, value): + # 定义一个全局变量 + _global_dict[key] = value + + +def get_value(key): + # 获得一个全局变量,不存在则提示读取对应变量失败 + try: + return _global_dict[key] + except: + print('读取' + key + '失败\r\n') diff --git a/app/configs/production.py b/app/configs/production.py index 45dd355..d2b294d 100644 --- a/app/configs/production.py +++ b/app/configs/production.py @@ -1,3 +1,3 @@ -from .default import * # NOQA F401 - -DEBUG = False +from .default import * # NOQA F401 + +DEBUG = False diff --git a/app/configs/testing.py b/app/configs/testing.py index cb6d2cc..e3966c8 100644 --- a/app/configs/testing.py +++ b/app/configs/testing.py @@ -1,14 +1,14 @@ -import os - -from .default import ROOT_PATH -from .default import * # NOQA F401 - - -TEST_BASE_DIR = os.path.join(ROOT_PATH, '.test') -SQLALCHEMY_DATABASE_URI = 'sqlite:///{}'.format( - os.path.join(TEST_BASE_DIR, 'demo.db')) -# SQLALCHEMY_ECHO = True -TESTING = True - -if not os.path.exists(TEST_BASE_DIR): - os.makedirs(TEST_BASE_DIR) +import os + +from .default import ROOT_PATH +from .default import * # NOQA F401 + + +TEST_BASE_DIR = os.path.join(ROOT_PATH, '.test') +SQLALCHEMY_DATABASE_URI = 'sqlite:///{}'.format( + os.path.join(TEST_BASE_DIR, 'demo.db')) +# SQLALCHEMY_ECHO = True +TESTING = True + +if not os.path.exists(TEST_BASE_DIR): + os.makedirs(TEST_BASE_DIR) diff --git a/app/controller/AlgorithmController.py b/app/controller/AlgorithmController.py index d03fd75..9dd1ec2 100644 --- a/app/controller/AlgorithmController.py +++ b/app/controller/AlgorithmController.py @@ -1,486 +1,486 @@ -""" -@Time : 2022/9/20 16:17 -@Auth : 东 -@File :AlgorithmController.py -@IDE :PyCharm -@Motto:ABC(Always Be Coding) -@Desc:算法接口 - -""" -import json -from functools import wraps -from threading import Thread -from multiprocessing import Process -from time import sleep - -from flask import Blueprint, request - -from app.schemas.TrainResult import Report, ProcessValueList -from app.utils.RedisMQTool import Task -from app.utils.StandardizedOutput import output_wrapped -from app.utils.redis_config import redis_client -from app.utils.websocket_tool import manager -from app.configs.global_var import set_value -import sys -from pathlib import Path - -from pynvml import * -# FILE = Path(__file__).resolve() -# ROOT = FILE.parents[0] # YOLOv5 root directory -# if str(ROOT) not in sys.path: -# sys.path.append(str(ROOT)) # add ROOT to PATH -# sys.path.append("/mnt/sdc/algorithm/AICheck-MaskRCNN/app/maskrcnn_ppx") -# import ppx as pdx - -bp = Blueprint('AlgorithmController', __name__) - -ifKillDict = {} - -def start_train_algorithm(): - """ - 调用训练算法 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/start_train_algorithm', methods=['get']) - def wrapped_function(): - param = request.args.get('param') - id = request.args.get('id') - dict = manager.active_connections_dist - # t = Thread(target=func, args=(param, id)) - t = Process(target=func, args=(param, id, dict[id]), name=id) - set_value(key=id, value=False) - t.start() - return output_wrapped(0, 'success', '成功') - - return wrapped_function - - return wrapTheFunction - - -def start_test_algorithm(): - """ - 调用验证算法 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/start_test_algorithm', methods=['get']) - def wrapped_function_test(): - param = request.args.get('param') - id = request.args.get('id') - t = Thread(target=func, args=(param, id)) - t.start() - return output_wrapped(0, 'success', '成功') - - return wrapped_function_test - - return wrapTheFunction - - -def start_detect_algorithm(): - """ - 调用检测算法 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/start_detect_algorithm', methods=['get']) - def wrapped_function_detect(): - param = request.args.get('param') - id = request.args.get('id') - t = Thread(target=func, args=(param, id)) - t.start() - return output_wrapped(0, 'success', '成功') - - return wrapped_function_detect - - return wrapTheFunction - - -def start_download_pt(): - """ - 下载模型 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/start_download_pt', methods=['get']) - def wrapped_function_start_download_pt(): - param = request.args.get('param') - data = func(param) - return output_wrapped(0, 'success', data) - - return wrapped_function_start_download_pt - - return wrapTheFunction - - -def algorithm_process_value(): - """ - 获取中间值, redis订阅发布 - """ - - def wrapTheFunction(func): - @wraps(func) - def wrapped_function(*args, **kwargs): - data = func(*args, **kwargs) - print(data) - Task(redis_conn=redis_client.get_redis(), channel="ceshi").publish_task( - data={'code': 0, 'msg': 'success', 'data': data}) - return output_wrapped(0, 'success', data) - - return wrapped_function - - return wrapTheFunction - - -def algorithm_process_value_websocket(): - """ - 获取中间值, websocket发布 - """ - - def wrapTheFunction(func): - @wraps(func) - def wrapped_function(*args, **kwargs): - data = func(*args, **kwargs) - id = data["id"] - data_res = {'code': 0, "type": 'connected', 'msg': 'success', 'data': data} - manager.send_message_proj_json(message=data_res, id=id) - return data - - return wrapped_function - - return wrapTheFunction - -def algorithm_kill_value_websocket(): - """ - 获取kill值, websocket发布 - """ - - def wrapTheFunction(func): - @wraps(func) - def wrapped_function(*args, **kwargs): - data = func(*args, **kwargs) - id = data["id"] - data_res = {'code': 1, "type": 'kill', 'msg': 'success', 'data': data} - manager.send_message_proj_json(message=data_res, id=id) - return data - - return wrapped_function - - return wrapTheFunction - - -def algorithm_error_value_websocket(): - """ - 获取error值, websocket发布 - """ - - def wrapTheFunction(func): - @wraps(func) - def wrapped_function(*args, **kwargs): - data = func(*args, **kwargs) - id = data["id"] - data_res = {'code': 2, "type": 'error', 'msg': 'fail', 'data': data} - manager.send_message_proj_json(message=data_res, id=id) - return data - - return wrapped_function - - return wrapTheFunction - -def obtain_train_param(): - """ - 获取训练参数 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/obtain_train_param', methods=['get']) - def wrapped_function_train_param(*args, **kwargs): - data = func(*args, **kwargs) - return output_wrapped(0, 'success', data) - - return wrapped_function_train_param - - return wrapTheFunction - -def obtain_test_param(): - """ - 获取验证参数 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/obtain_test_param', methods=['get']) - def wrapped_function_test_param(*args, **kwargs): - data = func(*args, **kwargs) - return output_wrapped(0, 'success', data) - - return wrapped_function_test_param - - return wrapTheFunction - - -def obtain_detect_param(): - """ - 获取测试参数 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/obtain_detect_param', methods=['get']) - def wrapped_function_inf_param(*args, **kwargs): - data = func(*args, **kwargs) - return output_wrapped(0, 'success', data) - - return wrapped_function_inf_param - - return wrapTheFunction - - -def obtain_download_pt_param(): - """ - 获取下载模型参数 - """ - - def wrapTheFunction(func): - @wraps(func) - @bp.route('/obtain_download_pt_param', methods=['get']) - def wrapped_function_obtain_download_pt_param(*args, **kwargs): - data = func(*args, **kwargs) - return output_wrapped(0, 'success', data) - - return wrapped_function_obtain_download_pt_param - - return wrapTheFunction - -@bp.route('/change_ifKillDIct', methods=['get']) -def change_ifKillDIct(): - """ - 修改全局变量 - """ - id = request.args.get('id') - type = request.args.get('type') - set_value(id, type) - return output_wrapped(0, 'success') - - -# @start_train_algorithm() -# def start(param: str): -# """ -# 例子 -# """ -# print(param) -# process_value_list = ProcessValueList(name='1', value=[]) -# report = Report(rate_of_progess=0, process_value=[process_value_list], id='1') -# -# @algorithm_process_value_websocket() -# def process(v: int): -# print(v) -# report.rate_of_progess = ((v + 1) / 10) * 100 -# report.precision[0].value.append(v) -# return report.dict() -# -# for i in range(10): -# process(i) -# return report.dict() -from setparams import TrainParams -import os -from app.schemas.TrainResult import DetectProcessValueDice, DetectReport -from app import file_tool - - -def error_return(id: str, data): - """ - 算法出错,返回 - """ - data_res = {'code': 2, "type": 'error', 'msg': 'fail', 'data': data} - manager.send_message_proj_json(message=data_res, id=id) - -# 启动训练 -@start_train_algorithm() -def train_R0DY(params_str, id, getsomething): - print('**********************************') - print(getsomething) - print('**********************************') - manager.active_connections_dist[id] = getsomething - print('**********************************') - print(manager.active_connections_dist) - print('**********************************') - print(params_str) - print('**********************************') - from app.yolov5.train_server import train_start - params = TrainParams() - params.read_from_str(params_str) - print(params.get('device').value) - data_list = file_tool.get_file(ori_path=params.get('DatasetDir').value, type_list=params.get('CLASS_NAMES').value) - weights = params.get('resumeModPath').value # 初始化模型绝对路径 - img_size = params.get('img_size').value - savemodel = os.path.splitext(params.get('saveModDir').value)[0] + '_' + str(img_size) + '.pt' # 模型命名加上图像参数 - epoches = params.get('epochnum').value - batch_size = params.get('batch_size').value - device = params.get('device').value - #try: - train_start(weights, savemodel, epoches, img_size, batch_size, device, data_list, id, getsomething) - print("train down!") - # except Exception as e: - # print(repr(e)) - # error_return(id=id,data=repr(e)) - - -# 启动验证程序 - -@start_test_algorithm() -def validate_RODY(params_str, id): - from app.yolov5.validate_server import validate_start - params = TrainParams() - params.read_from_str(params_str) - weights = params.get('modPath').value # 验证模型绝对路径 - (filename, extension) = os.path.splitext(weights) # 文件名与后缀名分开 - img_size = int(filename.split('ROD')[1].split('_')[2]) # 获取图像参数 - # v_num = int(filename.split('ROD')[1].split('_')[1]) #获取版本号 - output = params.get('outputPath').value - batch_size = params.get('batch_size').default - device = params.get('device').value - - validate_start(weights, img_size, batch_size, device, output, id) - - -@start_detect_algorithm() -def detect_RODY(params_str, id): - from app.yolov5.detect_server import detect_start - params = TrainParams() - params.read_from_str(params_str) - weights = params.get('modPath').value # 检测模型绝对路径 - input = params.get('inputPath').value - outpath = params.get('outputPath').value - # (filename, extension) = os.path.splitext(weights) # 文件名与后缀名分开 - # img_size = int(filename.split('ROD')[1].split('_')[2]) #获取图像参数 - # v_num = int(filename.split('ROD')[1].split('_')[1]) #获取版本号 - # batch_size = params.get('batch_size').default - device = params.get('device').value - - detect_start(input, weights, outpath, device, id) - - -@start_download_pt() -def Export_model_RODY(params_str): - from app.yolov5.export import Start_Model_Export - import zipfile - params = TrainParams() - params.read_from_str(params_str) - exp_inputPath = params.get('exp_inputPath').value # 模型路径 - print('输入模型:', exp_inputPath) - exp_device = params.get('device').value - imgsz = params.get('imgsz').value - modellist = Start_Model_Export(exp_inputPath, exp_device, imgsz) - exp_outputPath = exp_inputPath.replace('pt', 'zip') # 压缩文件 - print('模型路径:',exp_outputPath) - zipf = zipfile.ZipFile(exp_outputPath, 'w') - for file in modellist: - zipf.write(file, arcname=Path(file).name) # 将torchscript和onnx模型压缩 - - return exp_outputPath - -@obtain_train_param() -def returnTrainParams(): - nvmlInit() - gpuDeviceCount = nvmlDeviceGetCount() # 获取Nvidia GPU块数 - _kernel = [f"cuda:{a}" for a in range(gpuDeviceCount)] - params_list = [ - {"index": 0, "name": "epochnum", "value": 10, "description": '训练轮次', "default": 100, "type": "I", 'show': True}, - {"index": 1, "name": "batch_size", "value": 4, "description": '批次图像数量', "default": 1, "type": "I", - 'show': True}, - {"index": 2, "name": "img_size", "value": 640, "description": '训练图像大小', "default": 640, "type": "I", - 'show': True}, - {"index": 3, "name": "device", "value": f'{_kernel[0]}', "description": '训练核心', "default": f'{_kernel[0]}', "type": "E", - "items": _kernel, 'show': False}, # _kernel - {"index": 4, "name": "saveModDir", "value": "E:/alg_demo-master/alg_demo/app/yolov5/best.pt", - "description": '保存模型路径', - "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", 'show': False}, - {"index": 5, "name": "resumeModPath", "value": '/yolov5s.pt', - "description": '继续训练路径', "default": '', "type": "S", - 'show': False}, - {"index": 6, "name": "resumeMod", "value": '', "description": '继续训练模型', "default": '', "type": "E", "items": '', - 'show': True}, - {"index": 7, "name": "CLASS_NAMES", "value": ['hole', '456'], "description": '类别名称', "default": '', "type": "L", - "items": '', - 'show': False}, - {"index": 8, "name": "DatasetDir", "value": "E:/aicheck/data_set/11442136178662604800/ori", - "description": '数据集路径', - "default": "./app/maskrcnn/datasets/test", "type": "S", 'show': False} # ORI_PATH - ] - # {"index": 9, "name": "saveEpoch", "value": 2, "description": '保存模型轮次', "default": 2, "type": "I", 'show': True}] - params_str = json.dumps(params_list) - return params_str - - -@obtain_test_param() -def returnValidateParams(): - # nvmlInit() - # gpuDeviceCount = nvmlDeviceGetCount() # 获取Nvidia GPU块数 - # _kernel = [f"cuda:{a}" for a in range(gpuDeviceCount)] - params_list = [ - {"index": 0, "name": "modPath", "value": "E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt", - "description": '验证模型路径', "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", 'show': False}, - {"index": 1, "name": "batch_size", "value": 1, "description": '批次图像数量', "default": 1, "type": "I", - 'show': False}, - {"index": 2, "name": "img_size", "value": 640, "description": '训练图像大小', "default": 640, "type": "I", - 'show': False}, - {"index": 3, "name": "outputPath", "value": 'E:/aicheck/data_set/11442136178662604800/val_results/', - "description": '输出结果路径', - "default": './app/maskrcnn/datasets/M006B_waibi/res', "type": "S", 'show': False}, - {"index": 4, "name": "device", "value": "0", "description": '训练核心', "default": "cuda", "type": "S", - "items": '', 'show': False} # _kernel - ] - # {"index": 9, "name": "saveEpoch", "value": 2, "description": '保存模型轮次', "default": 2, "type": "I", 'show': True}] - params_str = json.dumps(params_list) - return params_str - - -@obtain_detect_param() -def returnDetectParams(): - # nvmlInit() - # gpuDeviceCount = nvmlDeviceGetCount() # 获取Nvidia GPU块数 - # _kernel = [f"cuda:{a}" for a in range(gpuDeviceCount)] - params_list = [ - {"index": 0, "name": "inputPath", "value": 'E:/aicheck/data_set/11442136178662604800/input/', - "description": '输入图像路径', "default": './app/maskrcnn/datasets/M006B_waibi/JPEGImages', "type": "S", - 'show': False}, - {"index": 1, "name": "outputPath", "value": 'E:/aicheck/data_set/11442136178662604800/val_results/', - "description": '输出结果路径', - "default": './app/maskrcnn/datasets/M006B_waibi/res', "type": "S", 'show': False}, - {"index": 2, "name": "modPath", "value": "E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt", - "description": '模型路径', "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", 'show': False}, - {"index": 3, "name": "device", "value": "0", "description": '推理核', "default": "cpu", "type": "S", - 'show': False}, - ] - # {"index": 9, "name": "saveEpoch", "value": 2, "description": '保存模型轮次', "default": 2, "type": "I", 'show': True}] - params_str = json.dumps(params_list) - return params_str - - -@obtain_download_pt_param() -def returnDownloadParams(): - params_list = [ - {"index": 0, "name": "exp_inputPath", "value": 'E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt', - "description": '转化模型输入路径', - "default": 'E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt/', - "type": "S", 'show': False}, - {"index": 1, "name": "device", "value": 'gpu', "description": 'CPU或GPU', "default": 'gpu', "type": "S", - 'show': False}, - {"index": 2, "name": "imgsz", "value": 640, "description": '图像大小', "default": 640, "type": "I", - 'show': True} - ] - params_str = json.dumps(params_list) - return params_str - - -if __name__ == '__main__': - par = returnTrainParams() - print(par) - id='1' - train_R0DY(par,id) +""" +@Time : 2022/9/20 16:17 +@Auth : 东 +@File :AlgorithmController.py +@IDE :PyCharm +@Motto:ABC(Always Be Coding) +@Desc:算法接口 + +""" +import json +from functools import wraps +from threading import Thread +from multiprocessing import Process +from time import sleep + +from flask import Blueprint, request + +from app.schemas.TrainResult import Report, ProcessValueList +from app.utils.RedisMQTool import Task +from app.utils.StandardizedOutput import output_wrapped +from app.utils.redis_config import redis_client +from app.utils.websocket_tool import manager +from app.configs.global_var import set_value +import sys +from pathlib import Path + +from pynvml import * +# FILE = Path(__file__).resolve() +# ROOT = FILE.parents[0] # YOLOv5 root directory +# if str(ROOT) not in sys.path: +# sys.path.append(str(ROOT)) # add ROOT to PATH +# sys.path.append("/mnt/sdc/algorithm/AICheck-MaskRCNN/app/maskrcnn_ppx") +# import ppx as pdx + +bp = Blueprint('AlgorithmController', __name__) + +ifKillDict = {} + +def start_train_algorithm(): + """ + 调用训练算法 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/start_train_algorithm', methods=['get']) + def wrapped_function(): + param = request.args.get('param') + id = request.args.get('id') + dict = manager.active_connections_dist + # t = Thread(target=func, args=(param, id)) + t = Process(target=func, args=(param, id, dict[id]), name=id) + set_value(key=id, value=False) + t.start() + return output_wrapped(0, 'success', '成功') + + return wrapped_function + + return wrapTheFunction + + +def start_test_algorithm(): + """ + 调用验证算法 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/start_test_algorithm', methods=['get']) + def wrapped_function_test(): + param = request.args.get('param') + id = request.args.get('id') + t = Thread(target=func, args=(param, id)) + t.start() + return output_wrapped(0, 'success', '成功') + + return wrapped_function_test + + return wrapTheFunction + + +def start_detect_algorithm(): + """ + 调用检测算法 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/start_detect_algorithm', methods=['get']) + def wrapped_function_detect(): + param = request.args.get('param') + id = request.args.get('id') + t = Thread(target=func, args=(param, id)) + t.start() + return output_wrapped(0, 'success', '成功') + + return wrapped_function_detect + + return wrapTheFunction + + +def start_download_pt(): + """ + 下载模型 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/start_download_pt', methods=['get']) + def wrapped_function_start_download_pt(): + param = request.args.get('param') + data = func(param) + return output_wrapped(0, 'success', data) + + return wrapped_function_start_download_pt + + return wrapTheFunction + + +def algorithm_process_value(): + """ + 获取中间值, redis订阅发布 + """ + + def wrapTheFunction(func): + @wraps(func) + def wrapped_function(*args, **kwargs): + data = func(*args, **kwargs) + print(data) + Task(redis_conn=redis_client.get_redis(), channel="ceshi").publish_task( + data={'code': 0, 'msg': 'success', 'data': data}) + return output_wrapped(0, 'success', data) + + return wrapped_function + + return wrapTheFunction + + +def algorithm_process_value_websocket(): + """ + 获取中间值, websocket发布 + """ + + def wrapTheFunction(func): + @wraps(func) + def wrapped_function(*args, **kwargs): + data = func(*args, **kwargs) + id = data["id"] + data_res = {'code': 0, "type": 'connected', 'msg': 'success', 'data': data} + manager.send_message_proj_json(message=data_res, id=id) + return data + + return wrapped_function + + return wrapTheFunction + +def algorithm_kill_value_websocket(): + """ + 获取kill值, websocket发布 + """ + + def wrapTheFunction(func): + @wraps(func) + def wrapped_function(*args, **kwargs): + data = func(*args, **kwargs) + id = data["id"] + data_res = {'code': 1, "type": 'kill', 'msg': 'success', 'data': data} + manager.send_message_proj_json(message=data_res, id=id) + return data + + return wrapped_function + + return wrapTheFunction + + +def algorithm_error_value_websocket(): + """ + 获取error值, websocket发布 + """ + + def wrapTheFunction(func): + @wraps(func) + def wrapped_function(*args, **kwargs): + data = func(*args, **kwargs) + id = data["id"] + data_res = {'code': 2, "type": 'error', 'msg': 'fail', 'data': data} + manager.send_message_proj_json(message=data_res, id=id) + return data + + return wrapped_function + + return wrapTheFunction + +def obtain_train_param(): + """ + 获取训练参数 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/obtain_train_param', methods=['get']) + def wrapped_function_train_param(*args, **kwargs): + data = func(*args, **kwargs) + return output_wrapped(0, 'success', data) + + return wrapped_function_train_param + + return wrapTheFunction + +def obtain_test_param(): + """ + 获取验证参数 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/obtain_test_param', methods=['get']) + def wrapped_function_test_param(*args, **kwargs): + data = func(*args, **kwargs) + return output_wrapped(0, 'success', data) + + return wrapped_function_test_param + + return wrapTheFunction + + +def obtain_detect_param(): + """ + 获取测试参数 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/obtain_detect_param', methods=['get']) + def wrapped_function_inf_param(*args, **kwargs): + data = func(*args, **kwargs) + return output_wrapped(0, 'success', data) + + return wrapped_function_inf_param + + return wrapTheFunction + + +def obtain_download_pt_param(): + """ + 获取下载模型参数 + """ + + def wrapTheFunction(func): + @wraps(func) + @bp.route('/obtain_download_pt_param', methods=['get']) + def wrapped_function_obtain_download_pt_param(*args, **kwargs): + data = func(*args, **kwargs) + return output_wrapped(0, 'success', data) + + return wrapped_function_obtain_download_pt_param + + return wrapTheFunction + +@bp.route('/change_ifKillDIct', methods=['get']) +def change_ifKillDIct(): + """ + 修改全局变量 + """ + id = request.args.get('id') + type = request.args.get('type') + set_value(id, type) + return output_wrapped(0, 'success') + + +# @start_train_algorithm() +# def start(param: str): +# """ +# 例子 +# """ +# print(param) +# process_value_list = ProcessValueList(name='1', value=[]) +# report = Report(rate_of_progess=0, process_value=[process_value_list], id='1') +# +# @algorithm_process_value_websocket() +# def process(v: int): +# print(v) +# report.rate_of_progess = ((v + 1) / 10) * 100 +# report.precision[0].value.append(v) +# return report.dict() +# +# for i in range(10): +# process(i) +# return report.dict() +from setparams import TrainParams +import os +from app.schemas.TrainResult import DetectProcessValueDice, DetectReport +from app import file_tool + + +def error_return(id: str, data): + """ + 算法出错,返回 + """ + data_res = {'code': 2, "type": 'error', 'msg': 'fail', 'data': data} + manager.send_message_proj_json(message=data_res, id=id) + +# 启动训练 +@start_train_algorithm() +def train_R0DY(params_str, id, getsomething): + print('**********************************') + print(getsomething) + print('**********************************') + manager.active_connections_dist[id] = getsomething + print('**********************************') + print(manager.active_connections_dist) + print('**********************************') + print(params_str) + print('**********************************') + from app.yolov5.train_server import train_start + params = TrainParams() + params.read_from_str(params_str) + print(params.get('device').value) + data_list = file_tool.get_file(ori_path=params.get('DatasetDir').value, type_list=params.get('CLASS_NAMES').value) + weights = params.get('resumeModPath').value # 初始化模型绝对路径 + img_size = params.get('img_size').value + savemodel = os.path.splitext(params.get('saveModDir').value)[0] + '_' + str(img_size) + '.pt' # 模型命名加上图像参数 + epoches = params.get('epochnum').value + batch_size = params.get('batch_size').value + device = params.get('device').value + #try: + train_start(weights, savemodel, epoches, img_size, batch_size, device, data_list, id, getsomething) + print("train down!") + # except Exception as e: + # print(repr(e)) + # error_return(id=id,data=repr(e)) + + +# 启动验证程序 + +@start_test_algorithm() +def validate_RODY(params_str, id): + from app.yolov5.validate_server import validate_start + params = TrainParams() + params.read_from_str(params_str) + weights = params.get('modPath').value # 验证模型绝对路径 + (filename, extension) = os.path.splitext(weights) # 文件名与后缀名分开 + img_size = int(filename.split('ROD')[1].split('_')[2]) # 获取图像参数 + # v_num = int(filename.split('ROD')[1].split('_')[1]) #获取版本号 + output = params.get('outputPath').value + batch_size = params.get('batch_size').default + device = params.get('device').value + + validate_start(weights, img_size, batch_size, device, output, id) + + +@start_detect_algorithm() +def detect_RODY(params_str, id): + from app.yolov5.detect_server import detect_start + params = TrainParams() + params.read_from_str(params_str) + weights = params.get('modPath').value # 检测模型绝对路径 + input = params.get('inputPath').value + outpath = params.get('outputPath').value + # (filename, extension) = os.path.splitext(weights) # 文件名与后缀名分开 + # img_size = int(filename.split('ROD')[1].split('_')[2]) #获取图像参数 + # v_num = int(filename.split('ROD')[1].split('_')[1]) #获取版本号 + # batch_size = params.get('batch_size').default + device = params.get('device').value + + detect_start(input, weights, outpath, device, id) + + +@start_download_pt() +def Export_model_RODY(params_str): + from app.yolov5.export import Start_Model_Export + import zipfile + params = TrainParams() + params.read_from_str(params_str) + exp_inputPath = params.get('exp_inputPath').value # 模型路径 + print('输入模型:', exp_inputPath) + exp_device = params.get('device').value + imgsz = params.get('imgsz').value + modellist = Start_Model_Export(exp_inputPath, exp_device, imgsz) + exp_outputPath = exp_inputPath.replace('pt', 'zip') # 压缩文件 + print('模型路径:',exp_outputPath) + zipf = zipfile.ZipFile(exp_outputPath, 'w') + for file in modellist: + zipf.write(file, arcname=Path(file).name) # 将torchscript和onnx模型压缩 + + return exp_outputPath + +@obtain_train_param() +def returnTrainParams(): + nvmlInit() + gpuDeviceCount = nvmlDeviceGetCount() # 获取Nvidia GPU块数 + _kernel = [f"cuda:{a}" for a in range(gpuDeviceCount)] + params_list = [ + {"index": 0, "name": "epochnum", "value": 10, "description": '训练轮次', "default": 100, "type": "I", 'show': True}, + {"index": 1, "name": "batch_size", "value": 4, "description": '批次图像数量', "default": 1, "type": "I", + 'show': True}, + {"index": 2, "name": "img_size", "value": 640, "description": '训练图像大小', "default": 640, "type": "I", + 'show': True}, + {"index": 3, "name": "device", "value": f'{_kernel[0]}', "description": '训练核心', "default": f'{_kernel[0]}', "type": "E", + "items": _kernel, 'show': False}, # _kernel + {"index": 4, "name": "saveModDir", "value": "E:/alg_demo-master/alg_demo/app/yolov5/best.pt", + "description": '保存模型路径', + "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", 'show': False}, + {"index": 5, "name": "resumeModPath", "value": '/yolov5s.pt', + "description": '继续训练路径', "default": '', "type": "S", + 'show': False}, + {"index": 6, "name": "resumeMod", "value": '', "description": '继续训练模型', "default": '', "type": "E", "items": '', + 'show': True}, + {"index": 7, "name": "CLASS_NAMES", "value": ['hole', '456'], "description": '类别名称', "default": '', "type": "L", + "items": '', + 'show': False}, + {"index": 8, "name": "DatasetDir", "value": "E:/aicheck/data_set/11442136178662604800/ori", + "description": '数据集路径', + "default": "./app/maskrcnn/datasets/test", "type": "S", 'show': False} # ORI_PATH + ] + # {"index": 9, "name": "saveEpoch", "value": 2, "description": '保存模型轮次', "default": 2, "type": "I", 'show': True}] + params_str = json.dumps(params_list) + return params_str + + +@obtain_test_param() +def returnValidateParams(): + # nvmlInit() + # gpuDeviceCount = nvmlDeviceGetCount() # 获取Nvidia GPU块数 + # _kernel = [f"cuda:{a}" for a in range(gpuDeviceCount)] + params_list = [ + {"index": 0, "name": "modPath", "value": "E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt", + "description": '验证模型路径', "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", 'show': False}, + {"index": 1, "name": "batch_size", "value": 1, "description": '批次图像数量', "default": 1, "type": "I", + 'show': False}, + {"index": 2, "name": "img_size", "value": 640, "description": '训练图像大小', "default": 640, "type": "I", + 'show': False}, + {"index": 3, "name": "outputPath", "value": 'E:/aicheck/data_set/11442136178662604800/val_results/', + "description": '输出结果路径', + "default": './app/maskrcnn/datasets/M006B_waibi/res', "type": "S", 'show': False}, + {"index": 4, "name": "device", "value": "0", "description": '训练核心', "default": "cuda", "type": "S", + "items": '', 'show': False} # _kernel + ] + # {"index": 9, "name": "saveEpoch", "value": 2, "description": '保存模型轮次', "default": 2, "type": "I", 'show': True}] + params_str = json.dumps(params_list) + return params_str + + +@obtain_detect_param() +def returnDetectParams(): + # nvmlInit() + # gpuDeviceCount = nvmlDeviceGetCount() # 获取Nvidia GPU块数 + # _kernel = [f"cuda:{a}" for a in range(gpuDeviceCount)] + params_list = [ + {"index": 0, "name": "inputPath", "value": 'E:/aicheck/data_set/11442136178662604800/input/', + "description": '输入图像路径', "default": './app/maskrcnn/datasets/M006B_waibi/JPEGImages', "type": "S", + 'show': False}, + {"index": 1, "name": "outputPath", "value": 'E:/aicheck/data_set/11442136178662604800/val_results/', + "description": '输出结果路径', + "default": './app/maskrcnn/datasets/M006B_waibi/res', "type": "S", 'show': False}, + {"index": 2, "name": "modPath", "value": "E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt", + "description": '模型路径', "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", 'show': False}, + {"index": 3, "name": "device", "value": "0", "description": '推理核', "default": "cpu", "type": "S", + 'show': False}, + ] + # {"index": 9, "name": "saveEpoch", "value": 2, "description": '保存模型轮次', "default": 2, "type": "I", 'show': True}] + params_str = json.dumps(params_list) + return params_str + + +@obtain_download_pt_param() +def returnDownloadParams(): + params_list = [ + {"index": 0, "name": "exp_inputPath", "value": 'E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt', + "description": '转化模型输入路径', + "default": 'E:/alg_demo-master/alg_demo/app/yolov5/圆孔_123_RODY_1_640.pt/', + "type": "S", 'show': False}, + {"index": 1, "name": "device", "value": 'gpu', "description": 'CPU或GPU', "default": 'gpu', "type": "S", + 'show': False}, + {"index": 2, "name": "imgsz", "value": 640, "description": '图像大小', "default": 640, "type": "I", + 'show': True} + ] + params_str = json.dumps(params_list) + return params_str + + +if __name__ == '__main__': + par = returnTrainParams() + print(par) + id='1' + train_R0DY(par,id) diff --git a/app/controller/WebStatusController.py b/app/controller/WebStatusController.py index 14a64d9..cefbf68 100644 --- a/app/controller/WebStatusController.py +++ b/app/controller/WebStatusController.py @@ -1,33 +1,33 @@ -import logging - -from flask import Blueprint, app - -from app.exts import redisClient -from app.utils.StandardizedOutput import output_wrapped - -bp = Blueprint('WebStatus', __name__) - - -@bp.route('/ping', methods=['GET']) -def ping(): - """ For health check. - """ - res = output_wrapped(0, 'pong', '') - return res - - -@bp.route('/redis/set', methods=['post']) -def redis_set(): - redisClient.set('foo', 'bar', ex=60*60*6) - res = output_wrapped(0, 'set foo', '') - return res - - -@bp.route('/redis/get', methods=['get']) -def redis_get(): - """ For health check. - """ - the_food = redisClient.get('foo') - if not the_food: - return output_wrapped(5006, 'foo', "") - return output_wrapped(0, 'foo', the_food.decode("utf-8")) +import logging + +from flask import Blueprint, app + +from app.exts import redisClient +from app.utils.StandardizedOutput import output_wrapped + +bp = Blueprint('WebStatus', __name__) + + +@bp.route('/ping', methods=['GET']) +def ping(): + """ For health check. + """ + res = output_wrapped(0, 'pong', '') + return res + + +@bp.route('/redis/set', methods=['post']) +def redis_set(): + redisClient.set('foo', 'bar', ex=60*60*6) + res = output_wrapped(0, 'set foo', '') + return res + + +@bp.route('/redis/get', methods=['get']) +def redis_get(): + """ For health check. + """ + the_food = redisClient.get('foo') + if not the_food: + return output_wrapped(5006, 'foo', "") + return output_wrapped(0, 'foo', the_food.decode("utf-8")) diff --git a/app/controller/__init__.py b/app/controller/__init__.py index 5e6ec1b..4f75c25 100644 --- a/app/controller/__init__.py +++ b/app/controller/__init__.py @@ -1,4 +1,4 @@ -from app.core.common_utils import import_subs - - -__all__ = import_subs(locals(), modules_only=True) +from app.core.common_utils import import_subs + + +__all__ = import_subs(locals(), modules_only=True) diff --git a/app/controller/圆孔_123_RODY_1_640.zip b/app/controller/圆孔_123_RODY_1_640.zip index ebabd3fc082a992f2ceea74af3af5d9413c8b3df..28c2a0f8cad18ae04f51ed3c47c738d0097b49c9 100644 GIT binary patch delta 2036 zcmV~$2N)0n0EE%+E~6pRP=rbpg``x9G!SVb4Kt$>rP5GD;~Mxi5KS6XDovF=DioT^ z78Rw9WUu%3ub5nR(8yh-2SsrT1W-dsr)J~mT zn7XN#i*j-5=aMu?!!%0cT$;;rd79*kT$!f1D$UY7Ez&Zr(mGe?np~SUxh`$fF74AH z*XM@Zn45BQZb`@7n%i=F?ntL}PM6%7uDL6Br(3$`p7co1^vb>Ioj&QCez`CGGa&cp zfeg%pc_@Q2I72ct$*>I1h>Xm`c_fd9JeE-zoiQ1k$MZy<%(y(2r!zhiGBJ}fIaBgX zp3T%u%k<31b9p{9Gb^+6Lgr*{=HqAbpmyp*L`mgRXlujJLdme=z}-ppHh zJMUygR%TV+&3k!2tFtB_^GE*7U->)#n{z;!<&$xLh<5SBNV`Q*o7OCYp;DqNQjhT8pd2HR4*)MqDS_igu#C z=pe2aH;5a>P2y&8i|8nB6}O4o#T}xP=q$R3J4IJmDh!`e@ixFa^cvw6l9uJcqVuF|`CW*;nig-pmE2fHRV!D_io)gcDnPQfhEnX0F#9T2?yeQ_21!AFC zBo>P$;w7=y^bLGh#bN&GAhiC@HF@vHbv{4V|we~Q1v-{K$fulP?Rjf_nJbA&n49A%C+ z1x+DS*c36xn4;!bbDSw=jyJ_k2~*OPGAEeQri?k!oMg(Hlg%mSR8!8BHx2H1X0cgfUNTF~ zGPB&gY+f<1n%B(h<_+_vdCROo7HBG`M`W=J~C^~I^R3xtwwoR1JM+ESX?B?(%x<&C>^1w$esjPa aG(Vc3%+KbK`NbSIznb67@1FOESN#vwn;EkJ delta 3975 zcmaLW2Y6J~76ss}l>lQz3?Xz7Bx-Pskq{D!NkXoPXxKXP>?AKKD%Jg3nuTePT)bNZH!vTV0f{eYCIk zQ--=~f5mlxGIgM`bdb6!TiunT9?Dgoda9RttB(%WAv#ojm9GNzQ-2N6Kn>DiI$THS zNEK?Zj?&ROM#pN1j??iPsv-^32|7{3b&^KtWSyc@b(%)%bdAzz6>E%2bcV)ioW|=+ zP0&P@YLdz{SyMDs<(j7HnxUDRrL%OlX6qcy(YdNnrRM59&69M#F3@}}(1p547t6Xt zmujId(;{82E3{Zw>MC8WYjmxy)Ad@S8+4ssMZqcn;t`%CTRa&hzx=pvM zMtA5=-KDi!r@M8J?$v#|Uk~U(J*0>Ah#u8rdR$NFNv+pYdRouuSv{xc^@3j1OL|$a zXoFtWYkFO8=uN$)xAl%T>Rr93_w|83)Fy4#NBUS>^oc&zXZl=U=u3U2ul0?#>RWxM zZQ8Ey^@D!YPx@KE=vV!w-}Q(7r9bs={j~rFOgIrvf*Zk&;U;hl-VIKMcZZw8d%(@$ zJ>e9%Ih+c&fYacXa4Wbq+y-t7w}acm9pH}eUT`P4GrTw41x|?gEQc+@cwWd zJ^;>y4}`PegWzs(HryS~fqTHYa30(f?gjUT`@jdohroxzec^n#0PY9(hX=p|;X&|W z@Zs(MZ-Q@ztKntvE%2@Ia(D&25?%$bhS$Ki!MDRT@E!1-@Llj) zcpZE?#2`~dtQ{1E&w{0RIg{22T=`~>_YydHiEej0uTeinWXeja`Sei42N zei?oR-T=P}zXrb!zX87qzXiVyzXNZC--X|U--kbdKZG~Io8gb(kKrxwC-A56XYl9n z7x0(xSMb;HH}F>YTlhP88@wI<9{vIT5&jAO8U6+S75)wW9sUFU7yKvuZ}=}Pph1&P zq?71IbYr>+9iw-nlj+^*rt}_kGkQ-tg>Fu#(k3!&Z>HX*ox+}du9j6bVGwB2AEczh28=Xyer*r5YbS|Ao_oRE#z3D#m z!So^Yp>$t5pDv*L(f#QG^gwzLeHeW>eFS|ZT}Th6kD`yJkD-sHhtS8-$J0aUB6=8o z0(~MqoIZ&jL7z;YLZ3>XMvtUVr$^DF>0){eT|%EhkEO@ao<>inXV5e0S@c=-+4OAs9C{9YE?q%a(sSwa=y|m0^XUud`Sb$%Li!^5V%qd2 z^riGd`Z9VEeK~yvy_mj|zKXt@zJ|V*zK*`0UP9kM-$+-{OX-{Fo9SwL8GQ?VE4`dv zL9e7&(W~h-^lkL*bPat6eJ6bvy_Q}_-%Z~`-%H;|-%me4KS)1BKTJPDKT1DFKTbbE zKS{5rpQ4|ppP`?npQE3rU!Y&4U!q^8U!gb9uhOs4uhVbPZ_;nkZ`1G48|ioH_vrWO z59kl+P4s5^Bl=@{3;hZGDg7D!IsFCwCH)osHT?~}mHw9gj^0LZr@yCvpns%)qJO4; zp?~F?-?;wKjZO1Wm|C^{^=)ih^=IljG^y%4@@X_iQcZQId@wb>yz(-{Dj7bBvBVVg zuiD;n9a=Ujtc)fWrgzB?6a@MO`UeIC1_lNN4htL}I3jRlpfE5va8%&vz%hYi149DG z1&$944HN~21x^T@7#JQnDKH{%a^RG}se#i1BLk-gMg>NrQ+!D*>L%(WwX|$Z$;7Pg z*;&P9lV)U%9zUwQurgLt-K7{w?c%E{JJFUMS|`?amRXLZtf;esSY=Z9{8wkuZROPM#mtiNW5-R4o^ip#^z8B| zW%jhd^uUb3%)qR`S%I?yvjgV@<^;|SR0Jvma|7pv8%v2whlA9yecg?v)Kq8BL#$o= z_R46g_Ndj}Sce_^Rkiu|wMa{f?k8nodY^ewralUsAGiR`feQl{1uhOaa7p0Oz`{T{_xXzgmj|v0EDl^5 zxGHdU;F`d-f$IX-2bKhG2;3N`3M>uW6u3E19at8)C2(tCd0<6gWndMOceY&hZPZGu z`u}azasFx~?HR8winWYYM*CQMc&oNYdz}^?f})x&16L#7K3*DY89jsM_50N$t2C=y z-9MnHs<>=5in_*^tw2b@`V=j83C+&haX?m}CVg@g-cZ8q9SN(~*CpJ*kZ{Mb+cjbL zzY}g?P4QE!v7(`b-FGD1Qo06374Z(SaE_9)vwP$frX(a(=GTpcf`o*Gf?Z~NHZYqO z?Msu|wY>^siP3`aitoJIyD-+I?qWi`SzVRfZiPwFrGomXil}gIc46$V`q$3Ix!reJ z{CCRSoQ4YJ_ShwMN1@z*6bg0n{*|!zr&~v$;] +********************************** +********************************** +{'195095688265211904_17_detect': [, , , ], '194741569180540928_14_train': [], '194741569180540928_15_train': [], '194741569180540928_16_train': [], '194741569180540928_17_train': [], '194741569180540928_18_train': [], '194741569180540928_19_train': []} +********************************** +[{"index": 0, "name": "epochnum", "value": 10, "description": "\u8bad\u7ec3\u8f6e\u6b21", "default": 100, "type": "I", "show": true}, {"index": 1, "name": "batch_size", "value": 4, "description": "\u6279\u6b21\u56fe\u50cf\u6570\u91cf", "default": 1, "type": "I", "show": true}, {"index": 2, "name": "img_size", "value": 640, "description": "\u8bad\u7ec3\u56fe\u50cf\u5927\u5c0f", "default": 640, "type": "I", "show": true}, {"index": 3, "name": "device", "value": "cuda:0", "description": "\u8bad\u7ec3\u6838\u5fc3", "default": "cuda:0", "type": "E", "items": ["cuda:0", "cuda:1"], "show": false}, {"index": 4, "name": "saveModDir", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/1128test_194741569180540928_R-ODY_19.pt", "description": "\u4fdd\u5b58\u6a21\u578b\u8def\u5f84", "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", "show": false}, {"index": 5, "name": "resumeModPath", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights//yolov5s.pt", "description": "\u7ee7\u7eed\u8bad\u7ec3\u8def\u5f84", "default": "", "type": "S", "show": false}, {"index": 6, "name": "resumeMod", "value": "", "description": "\u7ee7\u7eed\u8bad\u7ec3\u6a21\u578b", "default": "", "type": "E", "items": "", "show": true}, {"index": 7, "name": "CLASS_NAMES", "value": ["hole", "456", "aeroplane", "tvmonitor", "train", "boat", "dog", "chair", "bird", "bicycle", "person", "bottle", "sheep", "cat"], "description": "\u7c7b\u522b\u540d\u79f0", "default": "", "type": "L", "items": "", "show": false}, {"index": 8, "name": "DatasetDir", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/194741569180540928/ori", "description": "\u6570\u636e\u96c6\u8def\u5f84", "default": "./app/maskrcnn/datasets/test", "type": "S", "show": false}] +********************************** +cuda:0 +图像: ['2007_000032.jpg', '2007_000241.jpg', '2007_000068.jpg', '4.jpg', '3.jpg', '2007_000033.jpg', '10.jpg', '2007_000042.jpg', '7.jpg', '2007_000170.jpg', '2007_001583.jpg', '8.jpg', '2007_000187.jpg', '1.jpg', '2007_001457.jpg', '2007_000061.jpg', '2007_000027.jpg', '2007_000063.jpg', '2007_000129.jpg', '5.jpg', '2007_000123.jpg', '2007_000121.jpg', '9.jpg', '2007_000175.jpg', '2007_000039.jpg', '2007_001430.jpg', '6.jpg', '2007_001585.jpg', '2.jpg'] +图像路径 /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/194741569180540928/ori/images/2007_000032.jpg +1111 +标签 /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/194741569180540928/ori/labels/2007_000032.json +2222 +ROOT############### /mnt/sdc/algorithm/R-ODY/app/yolov5 + + opt.device: cuda:0 + + + device: cuda:0 + +get in train() +Process 194741569180540928_19_train: +Traceback (most recent call last): + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/flask_sockets.py", line 40, in __call__ + handler, values = adapter.match() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/werkzeug/routing.py", line 1945, in match + raise NotFound() +werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap + self.run() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/multiprocessing/process.py", line 108, in run + self._target(*self._args, **self._kwargs) + File "/mnt/sdc/algorithm/R-ODY/app/controller/AlgorithmController.py", line 327, in train_R0DY + train_start(weights, savemodel, epoches, img_size, batch_size, device, data_list, id, getsomething) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 733, in train_start + main(opt,data_list,id,getsomething) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 630, in main + train(opt.hyp, opt, device, data_list,id,getsomething,callbacks) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 168, in train + model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 673, in to + return self._apply(convert) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/models/yolo.py", line 136, in _apply + self = super()._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 409, in _apply + param_applied = fn(param) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 671, in convert + return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/cuda/__init__.py", line 160, in _lazy_init + raise RuntimeError( +RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method +192.168.0.20 - - [2022-11-29 10:21:16] "GET /api/obtain_train_param HTTP/1.1" 200 1936 0.000878 +------进入websocket +存储ws连接对象 +192.168.0.20 - - [2022-11-29 10:21:27] "GET /api/start_train_algorithm?param=%5B%7B%22index%22%3A+0%2C+%22name%22%3A+%22epochnum%22%2C+%22value%22%3A+10%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu8f6e%5Cu6b21%22%2C+%22default%22%3A+100%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+1%2C+%22name%22%3A+%22batch_size%22%2C+%22value%22%3A+4%2C+%22description%22%3A+%22%5Cu6279%5Cu6b21%5Cu56fe%5Cu50cf%5Cu6570%5Cu91cf%22%2C+%22default%22%3A+1%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+2%2C+%22name%22%3A+%22img_size%22%2C+%22value%22%3A+640%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu56fe%5Cu50cf%5Cu5927%5Cu5c0f%22%2C+%22default%22%3A+640%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+3%2C+%22name%22%3A+%22device%22%2C+%22value%22%3A+%22cuda%3A0%22%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu6838%5Cu5fc3%22%2C+%22default%22%3A+%22cuda%3A0%22%2C+%22type%22%3A+%22E%22%2C+%22items%22%3A+%5B%22cuda%3A0%22%2C+%22cuda%3A1%22%5D%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+4%2C+%22name%22%3A+%22saveModDir%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2Fweights%2F1128test_194741569180540928_R-ODY_20.pt%22%2C+%22description%22%3A+%22%5Cu4fdd%5Cu5b58%5Cu6a21%5Cu578b%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22.%2Fapp%2Fmaskrcnn%2Fsaved_model%2Ftest.pt%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+5%2C+%22name%22%3A+%22resumeModPath%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2Fweights%2F%2Fyolov5s.pt%22%2C+%22description%22%3A+%22%5Cu7ee7%5Cu7eed%5Cu8bad%5Cu7ec3%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+6%2C+%22name%22%3A+%22resumeMod%22%2C+%22value%22%3A+%22%22%2C+%22description%22%3A+%22%5Cu7ee7%5Cu7eed%5Cu8bad%5Cu7ec3%5Cu6a21%5Cu578b%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22E%22%2C+%22items%22%3A+%22%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+7%2C+%22name%22%3A+%22CLASS_NAMES%22%2C+%22value%22%3A+%5B%22hole%22%2C+%22456%22%2C+%22aeroplane%22%2C+%22tvmonitor%22%2C+%22train%22%2C+%22boat%22%2C+%22dog%22%2C+%22chair%22%2C+%22bird%22%2C+%22bicycle%22%2C+%22person%22%2C+%22bottle%22%2C+%22sheep%22%2C+%22cat%22%5D%2C+%22description%22%3A+%22%5Cu7c7b%5Cu522b%5Cu540d%5Cu79f0%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22L%22%2C+%22items%22%3A+%22%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+8%2C+%22name%22%3A+%22DatasetDir%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2F194741569180540928%2Fori%22%2C+%22description%22%3A+%22%5Cu6570%5Cu636e%5Cu96c6%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22.%2Fapp%2Fmaskrcnn%2Fdatasets%2Ftest%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%5D&id=194741569180540928_20_train HTTP/1.1" 200 161 0.050371 +删除图片数据 +删除json数据 +train_server: weights=/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights//yolov5s.pt, savemodel=/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/1128test_194741569180540928_R-ODY_20_640.pt, cfg=, data=/mnt/sdc/algorithm/R-ODY/app/yolov5/data/coco128.yaml, hyp=/mnt/sdc/algorithm/R-ODY/app/yolov5/data/hyps/hyp.scratch-low.yaml, epochs=10, batch_size=4, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, bucket=, cache=None, image_weights=False, device=cuda:0, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=/mnt/sdc/algorithm/R-ODY/app/yolov5/runs/train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest +Weights & Biases: run 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs in Weights & Biases +ClearML: run 'pip install clearml' to automatically track, visualize and remotely train YOLOv5 🚀 in ClearML +TensorBoard: Start with 'tensorboard --logdir /mnt/sdc/algorithm/R-ODY/app/yolov5/runs/train', view at http://localhost:6006/ +Overriding model.yaml nc=80 with nc=14 + + from n params module arguments + 0 -1 1 3520 app.yolov5.models.common.Conv [3, 32, 6, 2, 2] + 1 -1 1 18560 app.yolov5.models.common.Conv [32, 64, 3, 2] + 2 -1 1 18816 app.yolov5.models.common.C3 [64, 64, 1] + 3 -1 1 73984 app.yolov5.models.common.Conv [64, 128, 3, 2] + 4 -1 2 115712 app.yolov5.models.common.C3 [128, 128, 2] + 5 -1 1 295424 app.yolov5.models.common.Conv [128, 256, 3, 2] + 6 -1 3 625152 app.yolov5.models.common.C3 [256, 256, 3] + 7 -1 1 1180672 app.yolov5.models.common.Conv [256, 512, 3, 2] + 8 -1 1 1182720 app.yolov5.models.common.C3 [512, 512, 1] + 9 -1 1 656896 app.yolov5.models.common.SPPF [512, 512, 5] + 10 -1 1 131584 app.yolov5.models.common.Conv [512, 256, 1, 1] + 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] + 12 [-1, 6] 1 0 app.yolov5.models.common.Concat [1] + 13 -1 1 361984 app.yolov5.models.common.C3 [512, 256, 1, False] + 14 -1 1 33024 app.yolov5.models.common.Conv [256, 128, 1, 1] + 15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] + 16 [-1, 4] 1 0 app.yolov5.models.common.Concat [1] + 17 -1 1 90880 app.yolov5.models.common.C3 [256, 128, 1, False] + 18 -1 1 147712 app.yolov5.models.common.Conv [128, 128, 3, 2] + 19 [-1, 14] 1 0 app.yolov5.models.common.Concat [1] + 20 -1 1 296448 app.yolov5.models.common.C3 [256, 256, 1, False] + 21 -1 1 590336 app.yolov5.models.common.Conv [256, 256, 3, 2] + 22 [-1, 10] 1 0 app.yolov5.models.common.Concat [1] + 23 -1 1 1182720 app.yolov5.models.common.C3 [512, 512, 1, False] + 24 [17, 20, 23] 1 51243 app.yolov5.models.yolo.Detect [14, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]] +Model summary: 270 layers, 7057387 parameters, 7057387 gradients, 16.1 GFLOPs + +********************************** +[] +********************************** +********************************** +{'195095688265211904_17_detect': [, , , ], '194741569180540928_14_train': [], '194741569180540928_15_train': [], '194741569180540928_16_train': [], '194741569180540928_17_train': [], '194741569180540928_18_train': [], '194741569180540928_19_train': [], '194741569180540928_20_train': []} +********************************** +[{"index": 0, "name": "epochnum", "value": 10, "description": "\u8bad\u7ec3\u8f6e\u6b21", "default": 100, "type": "I", "show": true}, {"index": 1, "name": "batch_size", "value": 4, "description": "\u6279\u6b21\u56fe\u50cf\u6570\u91cf", "default": 1, "type": "I", "show": true}, {"index": 2, "name": "img_size", "value": 640, "description": "\u8bad\u7ec3\u56fe\u50cf\u5927\u5c0f", "default": 640, "type": "I", "show": true}, {"index": 3, "name": "device", "value": "cuda:0", "description": "\u8bad\u7ec3\u6838\u5fc3", "default": "cuda:0", "type": "E", "items": ["cuda:0", "cuda:1"], "show": false}, {"index": 4, "name": "saveModDir", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/1128test_194741569180540928_R-ODY_20.pt", "description": "\u4fdd\u5b58\u6a21\u578b\u8def\u5f84", "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", "show": false}, {"index": 5, "name": "resumeModPath", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights//yolov5s.pt", "description": "\u7ee7\u7eed\u8bad\u7ec3\u8def\u5f84", "default": "", "type": "S", "show": false}, {"index": 6, "name": "resumeMod", "value": "", "description": "\u7ee7\u7eed\u8bad\u7ec3\u6a21\u578b", "default": "", "type": "E", "items": "", "show": true}, {"index": 7, "name": "CLASS_NAMES", "value": ["hole", "456", "aeroplane", "tvmonitor", "train", "boat", "dog", "chair", "bird", "bicycle", "person", "bottle", "sheep", "cat"], "description": "\u7c7b\u522b\u540d\u79f0", "default": "", "type": "L", "items": "", "show": false}, {"index": 8, "name": "DatasetDir", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/194741569180540928/ori", "description": "\u6570\u636e\u96c6\u8def\u5f84", "default": "./app/maskrcnn/datasets/test", "type": "S", "show": false}] +********************************** +cuda:0 +图像: ['2007_000032.jpg', '2007_000241.jpg', '2007_000068.jpg', '4.jpg', '3.jpg', '2007_000033.jpg', '10.jpg', '2007_000042.jpg', '7.jpg', '2007_000170.jpg', '2007_001583.jpg', '8.jpg', '2007_000187.jpg', '1.jpg', '2007_001457.jpg', '2007_000061.jpg', '2007_000027.jpg', '2007_000063.jpg', '2007_000129.jpg', '5.jpg', '2007_000123.jpg', '2007_000121.jpg', '9.jpg', '2007_000175.jpg', '2007_000039.jpg', '2007_001430.jpg', '6.jpg', '2007_001585.jpg', '2.jpg'] +图像路径 /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/194741569180540928/ori/images/2007_000032.jpg +1111 +标签 /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/194741569180540928/ori/labels/2007_000032.json +2222 +ROOT############### /mnt/sdc/algorithm/R-ODY/app/yolov5 + + opt.device: cuda:0 + + + device: cuda:0 + +get in train() +Process 194741569180540928_20_train: +Traceback (most recent call last): + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/flask_sockets.py", line 40, in __call__ + handler, values = adapter.match() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/werkzeug/routing.py", line 1945, in match + raise NotFound() +werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap + self.run() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/multiprocessing/process.py", line 108, in run + self._target(*self._args, **self._kwargs) + File "/mnt/sdc/algorithm/R-ODY/app/controller/AlgorithmController.py", line 327, in train_R0DY + train_start(weights, savemodel, epoches, img_size, batch_size, device, data_list, id, getsomething) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 733, in train_start + main(opt,data_list,id,getsomething) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 630, in main + train(opt.hyp, opt, device, data_list,id,getsomething,callbacks) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 168, in train + model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 673, in to + return self._apply(convert) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/models/yolo.py", line 136, in _apply + self = super()._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 409, in _apply + param_applied = fn(param) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 671, in convert + return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/cuda/__init__.py", line 160, in _lazy_init + raise RuntimeError( +RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method +192.168.0.20 - - [2022-11-29 10:21:55] "GET /api/obtain_train_param HTTP/1.1" 200 1936 0.000899 +------进入websocket +存储ws连接对象 +192.168.0.20 - - [2022-11-29 10:22:24] "GET /api/start_train_algorithm?param=%5B%7B%22index%22%3A+0%2C+%22name%22%3A+%22epochnum%22%2C+%22value%22%3A+10%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu8f6e%5Cu6b21%22%2C+%22default%22%3A+100%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+1%2C+%22name%22%3A+%22batch_size%22%2C+%22value%22%3A+4%2C+%22description%22%3A+%22%5Cu6279%5Cu6b21%5Cu56fe%5Cu50cf%5Cu6570%5Cu91cf%22%2C+%22default%22%3A+1%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+2%2C+%22name%22%3A+%22img_size%22%2C+%22value%22%3A+640%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu56fe%5Cu50cf%5Cu5927%5Cu5c0f%22%2C+%22default%22%3A+640%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+3%2C+%22name%22%3A+%22device%22%2C+%22value%22%3A+%22cuda%3A0%22%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu6838%5Cu5fc3%22%2C+%22default%22%3A+%22cuda%3A0%22%2C+%22type%22%3A+%22E%22%2C+%22items%22%3A+%5B%22cuda%3A0%22%2C+%22cuda%3A1%22%5D%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+4%2C+%22name%22%3A+%22saveModDir%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2Fweights%2F%5Cu6838%5Cu9178%5Cu68c0%5Cu6d4b_190857268466688000_R-ODY_18.pt%22%2C+%22description%22%3A+%22%5Cu4fdd%5Cu5b58%5Cu6a21%5Cu578b%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22.%2Fapp%2Fmaskrcnn%2Fsaved_model%2Ftest.pt%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+5%2C+%22name%22%3A+%22resumeModPath%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2Fweights%2F%2Fyolov5s.pt%22%2C+%22description%22%3A+%22%5Cu7ee7%5Cu7eed%5Cu8bad%5Cu7ec3%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+6%2C+%22name%22%3A+%22resumeMod%22%2C+%22value%22%3A+%22%2F1128test_194741569180540928_R-ODY_13_640.pt%22%2C+%22description%22%3A+%22%5Cu7ee7%5Cu7eed%5Cu8bad%5Cu7ec3%5Cu6a21%5Cu578b%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22E%22%2C+%22items%22%3A+%22%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+7%2C+%22name%22%3A+%22CLASS_NAMES%22%2C+%22value%22%3A+%5B%22hole%22%2C+%22456%22%2C+%22zui%22%2C+%22mianbang%22%5D%2C+%22description%22%3A+%22%5Cu7c7b%5Cu522b%5Cu540d%5Cu79f0%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22L%22%2C+%22items%22%3A+%22%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+8%2C+%22name%22%3A+%22DatasetDir%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2F190857268466688000%2Fori%22%2C+%22description%22%3A+%22%5Cu6570%5Cu636e%5Cu96c6%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22.%2Fapp%2Fmaskrcnn%2Fdatasets%2Ftest%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%5D&id=190857268466688000_18_train HTTP/1.1" 200 161 0.050019 +删除图片数据 +删除json数据 +192.168.0.20 - - [2022-11-29 10:22:26] "GET /api/obtain_download_pt_param HTTP/1.1" 200 792 0.000835 +train_server: weights=/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights//yolov5s.pt, savemodel=/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_18_640.pt, cfg=, data=/mnt/sdc/algorithm/R-ODY/app/yolov5/data/coco128.yaml, hyp=/mnt/sdc/algorithm/R-ODY/app/yolov5/data/hyps/hyp.scratch-low.yaml, epochs=10, batch_size=4, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, bucket=, cache=None, image_weights=False, device=cuda:0, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=/mnt/sdc/algorithm/R-ODY/app/yolov5/runs/train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest +Weights & Biases: run 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs in Weights & Biases +ClearML: run 'pip install clearml' to automatically track, visualize and remotely train YOLOv5 🚀 in ClearML +TensorBoard: Start with 'tensorboard --logdir /mnt/sdc/algorithm/R-ODY/app/yolov5/runs/train', view at http://localhost:6006/ +Overriding model.yaml nc=80 with nc=4 + + from n params module arguments + 0 -1 1 3520 app.yolov5.models.common.Conv [3, 32, 6, 2, 2] + 1 -1 1 18560 app.yolov5.models.common.Conv [32, 64, 3, 2] + 2 -1 1 18816 app.yolov5.models.common.C3 [64, 64, 1] + 3 -1 1 73984 app.yolov5.models.common.Conv [64, 128, 3, 2] + 4 -1 2 115712 app.yolov5.models.common.C3 [128, 128, 2] + 5 -1 1 295424 app.yolov5.models.common.Conv [128, 256, 3, 2] + 6 -1 3 625152 app.yolov5.models.common.C3 [256, 256, 3] + 7 -1 1 1180672 app.yolov5.models.common.Conv [256, 512, 3, 2] + 8 -1 1 1182720 app.yolov5.models.common.C3 [512, 512, 1] + 9 -1 1 656896 app.yolov5.models.common.SPPF [512, 512, 5] + 10 -1 1 131584 app.yolov5.models.common.Conv [512, 256, 1, 1] + 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] + 12 [-1, 6] 1 0 app.yolov5.models.common.Concat [1] + 13 -1 1 361984 app.yolov5.models.common.C3 [512, 256, 1, False] + 14 -1 1 33024 app.yolov5.models.common.Conv [256, 128, 1, 1] + 15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] + 16 [-1, 4] 1 0 app.yolov5.models.common.Concat [1] + 17 -1 1 90880 app.yolov5.models.common.C3 [256, 128, 1, False] + 18 -1 1 147712 app.yolov5.models.common.Conv [128, 128, 3, 2] + 19 [-1, 14] 1 0 app.yolov5.models.common.Concat [1] + 20 -1 1 296448 app.yolov5.models.common.C3 [256, 256, 1, False] + 21 -1 1 590336 app.yolov5.models.common.Conv [256, 256, 3, 2] + 22 [-1, 10] 1 0 app.yolov5.models.common.Concat [1] + 23 -1 1 1182720 app.yolov5.models.common.C3 [512, 512, 1, False] + 24 [17, 20, 23] 1 24273 app.yolov5.models.yolo.Detect [4, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]] +Model summary: 270 layers, 7030417 parameters, 7030417 gradients, 16.0 GFLOPs + +********************************** +[] +********************************** +********************************** +{'195095688265211904_17_detect': [, , , ], '194741569180540928_14_train': [], '194741569180540928_15_train': [], '194741569180540928_16_train': [], '194741569180540928_17_train': [], '194741569180540928_18_train': [], '194741569180540928_19_train': [], '194741569180540928_20_train': [], '190857268466688000_18_train': []} +********************************** +[{"index": 0, "name": "epochnum", "value": 10, "description": "\u8bad\u7ec3\u8f6e\u6b21", "default": 100, "type": "I", "show": true}, {"index": 1, "name": "batch_size", "value": 4, "description": "\u6279\u6b21\u56fe\u50cf\u6570\u91cf", "default": 1, "type": "I", "show": true}, {"index": 2, "name": "img_size", "value": 640, "description": "\u8bad\u7ec3\u56fe\u50cf\u5927\u5c0f", "default": 640, "type": "I", "show": true}, {"index": 3, "name": "device", "value": "cuda:0", "description": "\u8bad\u7ec3\u6838\u5fc3", "default": "cuda:0", "type": "E", "items": ["cuda:0", "cuda:1"], "show": false}, {"index": 4, "name": "saveModDir", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/\u6838\u9178\u68c0\u6d4b_190857268466688000_R-ODY_18.pt", "description": "\u4fdd\u5b58\u6a21\u578b\u8def\u5f84", "default": "./app/maskrcnn/saved_model/test.pt", "type": "S", "show": false}, {"index": 5, "name": "resumeModPath", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights//yolov5s.pt", "description": "\u7ee7\u7eed\u8bad\u7ec3\u8def\u5f84", "default": "", "type": "S", "show": false}, {"index": 6, "name": "resumeMod", "value": "/1128test_194741569180540928_R-ODY_13_640.pt", "description": "\u7ee7\u7eed\u8bad\u7ec3\u6a21\u578b", "default": "", "type": "E", "items": "", "show": true}, {"index": 7, "name": "CLASS_NAMES", "value": ["hole", "456", "zui", "mianbang"], "description": "\u7c7b\u522b\u540d\u79f0", "default": "", "type": "L", "items": "", "show": false}, {"index": 8, "name": "DatasetDir", "value": "/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/190857268466688000/ori", "description": "\u6570\u636e\u96c6\u8def\u5f84", "default": "./app/maskrcnn/datasets/test", "type": "S", "show": false}] +********************************** +cuda:0 +图像: ['IMG_20221117_132941~1.jpg', 'IMG_20221117_133002~1.jpg', 'IMG_20221117_152005~1.jpg', 'IMG_20221117_133005~1.jpg', 'IMG_20221117_132939~1.jpg', 'IMG_20221117_151945~1.jpg', 'IMG_20221117_133009~1.jpg', 'IMG_20221117_152023~1.jpg', 'IMG_20221117_133035~1.jpg', 'IMG_20221117_132947~1.jpg', 'IMG_20221117_151925~1.jpg', 'IMG_20221117_152026~1.jpg', 'IMG_20221117_133037~1.jpg', 'IMG_20221117_152018~1.jpg', 'IMG_20221117_152002~1.jpg', 'IMG_20221117_152004~1.jpg', 'IMG_20221117_152019~1.jpg', 'IMG_20221117_133006~1.jpg', 'IMG_20221117_152020~1.jpg', 'IMG_20221117_151959~1.jpg', 'IMG_20221117_152024~1.jpg', 'IMG_20221117_151921~1.jpg', 'IMG_20221117_151923~1.jpg', 'IMG_20221117_133038~1.jpg', 'IMG_20221117_151943~1.jpg', 'IMG_20221117_151924~1.jpg', 'IMG_20221117_152022~1.jpg', 'IMG_20221117_133032~1.jpg', 'IMG_20221117_151957~1.jpg', 'IMG_20221117_151939~1.jpg', 'IMG_20221117_133040~1.jpg', 'IMG_20221117_151946~1.jpg', 'IMG_20221117_151944~1.jpg', 'IMG_20221117_133007~1.jpg', 'IMG_20221117_132946~1.jpg', 'IMG_20221117_133004~1.jpg', 'IMG_20221117_152001~1.jpg', 'IMG_20221117_151941~1.jpg', 'IMG_20221117_151919~1.jpg', 'IMG_20221117_132944~1.jpg'] +图像路径 /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/190857268466688000/ori/images/IMG_20221117_132941~1.jpg +1111 +标签 /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/190857268466688000/ori/labels/IMG_20221117_132941~1.json +2222 +ROOT############### /mnt/sdc/algorithm/R-ODY/app/yolov5 + + opt.device: cuda:0 + + + device: cuda:0 + +get in train() +Process 190857268466688000_18_train: +Traceback (most recent call last): + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/flask_sockets.py", line 40, in __call__ + handler, values = adapter.match() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/werkzeug/routing.py", line 1945, in match + raise NotFound() +werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap + self.run() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/multiprocessing/process.py", line 108, in run + self._target(*self._args, **self._kwargs) + File "/mnt/sdc/algorithm/R-ODY/app/controller/AlgorithmController.py", line 327, in train_R0DY + train_start(weights, savemodel, epoches, img_size, batch_size, device, data_list, id, getsomething) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 733, in train_start + main(opt,data_list,id,getsomething) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 630, in main + train(opt.hyp, opt, device, data_list,id,getsomething,callbacks) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/train_server.py", line 168, in train + model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 673, in to + return self._apply(convert) + File "/mnt/sdc/algorithm/R-ODY/app/yolov5/models/yolo.py", line 136, in _apply + self = super()._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply + module._apply(fn) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 409, in _apply + param_applied = fn(param) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/nn/modules/module.py", line 671, in convert + return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/torch/cuda/__init__.py", line 160, in _lazy_init + raise RuntimeError( +RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method +export: data=app/yolov5/data/coco128.yaml, weights=/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.pt, imgsz=[640, 640], batch_size=1, device=0, half=False, inplace=False, train=False, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=11, verbose=False, workspace=4, nms=False, agnostic_nms=False, topk_per_class=100, topk_all=100, iou_thres=0.45, conf_thres=0.25, include=['torchscript', 'onnx'] YOLOv5 🚀 2022-11-7 Python-3.8.13 torch-1.8.0+cu111 CUDA:0 (Tesla T4, 15110MiB) Fusing layers... Model summary: 213 layers, 7020913 parameters, 0 gradients, 15.8 GFLOPs -PyTorch: starting from /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.pt with output shape (1, 25200, 9) (13.8 MB) +PyTorch: starting from /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.pt with output shape (1, 25200, 9) (13.8 MB) TorchScript: starting export with torch 1.8.0+cu111... -TorchScript: export success ✅ 0.9s, saved as /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.torchscript (27.3 MB) +TorchScript: export success ✅ 1.0s, saved as /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.torchscript (27.3 MB) ONNX: starting export with onnx 1.12.0... -ONNX: export success ✅ 1.8s, saved as /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx (27.2 MB) +ONNX: export success ✅ 1.6s, saved as /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.onnx (27.2 MB) -Export complete (6.5s) -Results saved to /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights -Detect: python detect.py --weights /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx -Validate: python val.py --weights /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx -PyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'custom', '/mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx') +Export complete (2.8s) +Results saved to /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights +Detect: python detect.py --weights /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.onnx +Validate: python val.py --weights /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.onnx +PyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'custom', '/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.onnx') Visualize: https://netron.app -192.168.0.20 - - [2022-11-24 08:59:15] "GET /api/start_download_pt?param=%5B%7B%22index%22%3A+0%2C+%22name%22%3A+%22exp_inputPath%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2Faicheck%2FIntelligentizeAI%2Fdata_set%2Fweights%2Fces2_193120735164768256_R-ODY_2_640.pt%22%2C+%22description%22%3A+%22%5Cu8f6c%5Cu5316%5Cu6a21%5Cu578b%5Cu8f93%5Cu5165%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22E%3A%2Falg_demo-master%2Falg_demo%2Fapp%2Fyolov5%2F%5Cu5706%5Cu5b54_123_RODY_1_640.pt%2F%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+1%2C+%22name%22%3A+%22device%22%2C+%22value%22%3A+%22gpu%22%2C+%22description%22%3A+%22CPU%5Cu6216GPU%22%2C+%22default%22%3A+%22gpu%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+2%2C+%22name%22%3A+%22imgsz%22%2C+%22value%22%3A+640%2C+%22description%22%3A+%22%5Cu56fe%5Cu50cf%5Cu5927%5Cu5c0f%22%2C+%22default%22%3A+640%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%5D&id=875 HTTP/1.1" 200 240 7.984953 -export: data=app/yolov5/data/coco128.yaml, weights=/mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.pt, imgsz=[640, 640], batch_size=1, device=0, half=False, inplace=False, train=False, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=11, verbose=False, workspace=4, nms=False, agnostic_nms=False, topk_per_class=100, topk_all=100, iou_thres=0.45, conf_thres=0.25, include=['torchscript', 'onnx'] -YOLOv5 🚀 2022-11-7 Python-3.8.13 torch-1.8.0+cu111 CUDA:0 (Tesla T4, 15110MiB) +192.168.0.20 - - [2022-11-29 10:22:31] "GET /api/start_download_pt?param=%5B%7B%22index%22%3A+0%2C+%22name%22%3A+%22exp_inputPath%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2Fweights%2F%5Cu6838%5Cu9178%5Cu68c0%5Cu6d4b_190857268466688000_R-ODY_17_640.pt%22%2C+%22description%22%3A+%22%5Cu8f6c%5Cu5316%5Cu6a21%5Cu578b%5Cu8f93%5Cu5165%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22E%3A%2Falg_demo-master%2Falg_demo%2Fapp%2Fyolov5%2F%5Cu5706%5Cu5b54_123_RODY_1_640.pt%2F%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+1%2C+%22name%22%3A+%22device%22%2C+%22value%22%3A+%22gpu%22%2C+%22description%22%3A+%22CPU%5Cu6216GPU%22%2C+%22default%22%3A+%22gpu%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+2%2C+%22name%22%3A+%22imgsz%22%2C+%22value%22%3A+640%2C+%22description%22%3A+%22%5Cu56fe%5Cu50cf%5Cu5927%5Cu5c0f%22%2C+%22default%22%3A+640%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%5D&id=737 HTTP/1.1" 200 270 3.030957 +------进入websocket +输入模型: /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.pt +['torchscript', 'onnx'] +['torchscript', 'onnx'] +('torchscript', 'onnx', 'openvino', 'engine', 'coreml', 'saved_model', 'pb', 'tflite', 'edgetpu', 'tfjs') +True +模型路径: /mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/核酸检测_190857268466688000_R-ODY_17_640.zip +存储ws连接对象 +192.168.0.20 - - [2022-11-29 10:44:19] "GET /api/start_train_algorithm?param=%5B%7B%22index%22%3A+0%2C+%22name%22%3A+%22epochnum%22%2C+%22value%22%3A+10%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu8f6e%5Cu6b21%22%2C+%22default%22%3A+100%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+1%2C+%22name%22%3A+%22batch_size%22%2C+%22value%22%3A+4%2C+%22description%22%3A+%22%5Cu6279%5Cu6b21%5Cu56fe%5Cu50cf%5Cu6570%5Cu91cf%22%2C+%22default%22%3A+1%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+2%2C+%22name%22%3A+%22img_size%22%2C+%22value%22%3A+640%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu56fe%5Cu50cf%5Cu5927%5Cu5c0f%22%2C+%22default%22%3A+640%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+3%2C+%22name%22%3A+%22device%22%2C+%22value%22%3A+%22cuda%3A0%22%2C+%22description%22%3A+%22%5Cu8bad%5Cu7ec3%5Cu6838%5Cu5fc3%22%2C+%22default%22%3A+%22cuda%3A0%22%2C+%22type%22%3A+%22E%22%2C+%22items%22%3A+%5B%22cuda%3A0%22%2C+%22cuda%3A1%22%5D%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+4%2C+%22name%22%3A+%22saveModDir%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2Fweights%2F1128test_194741569180540928_R-ODY_21.pt%22%2C+%22description%22%3A+%22%5Cu4fdd%5Cu5b58%5Cu6a21%5Cu578b%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22.%2Fapp%2Fmaskrcnn%2Fsaved_model%2Ftest.pt%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+5%2C+%22name%22%3A+%22resumeModPath%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2Fweights%2F%2Fyolov5s.pt%22%2C+%22description%22%3A+%22%5Cu7ee7%5Cu7eed%5Cu8bad%5Cu7ec3%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+6%2C+%22name%22%3A+%22resumeMod%22%2C+%22value%22%3A+%22%22%2C+%22description%22%3A+%22%5Cu7ee7%5Cu7eed%5Cu8bad%5Cu7ec3%5Cu6a21%5Cu578b%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22E%22%2C+%22items%22%3A+%22%22%2C+%22show%22%3A+true%7D%2C+%7B%22index%22%3A+7%2C+%22name%22%3A+%22CLASS_NAMES%22%2C+%22value%22%3A+%5B%22hole%22%2C+%22456%22%2C+%22aeroplane%22%2C+%22tvmonitor%22%2C+%22train%22%2C+%22boat%22%2C+%22dog%22%2C+%22chair%22%2C+%22bird%22%2C+%22bicycle%22%2C+%22person%22%2C+%22bottle%22%2C+%22sheep%22%2C+%22cat%22%5D%2C+%22description%22%3A+%22%5Cu7c7b%5Cu522b%5Cu540d%5Cu79f0%22%2C+%22default%22%3A+%22%22%2C+%22type%22%3A+%22L%22%2C+%22items%22%3A+%22%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+8%2C+%22name%22%3A+%22DatasetDir%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2FIntelligentizeAI%2FIntelligentizeAI%2Fdata_set%2F194741569180540928%2Fori%22%2C+%22description%22%3A+%22%5Cu6570%5Cu636e%5Cu96c6%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22.%2Fapp%2Fmaskrcnn%2Fdatasets%2Ftest%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%5D&id=194741569180540928_21_train HTTP/1.1" 200 161 0.051209 +删除图片数据 +删除json数据 +train_server: weights=/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights//yolov5s.pt, savemodel=/mnt/sdc/IntelligentizeAI/IntelligentizeAI/data_set/weights/1128test_194741569180540928_R-ODY_21_640.pt, cfg=, data=/mnt/sdc/algorithm/R-ODY/app/yolov5/data/coco128.yaml, hyp=/mnt/sdc/algorithm/R-ODY/app/yolov5/data/hyps/hyp.scratch-low.yaml, epochs=10, batch_size=4, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, bucket=, cache=None, image_weights=False, device=cuda:0, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=/mnt/sdc/algorithm/R-ODY/app/yolov5/runs/train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest +Weights & Biases: run 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs in Weights & Biases +ClearML: run 'pip install clearml' to automatically track, visualize and remotely train YOLOv5 🚀 in ClearML +TensorBoard: Start with 'tensorboard --logdir /mnt/sdc/algorithm/R-ODY/app/yolov5/runs/train', view at http://localhost:6006/ +Overriding model.yaml nc=80 with nc=14 -Fusing layers... -Model summary: 213 layers, 7020913 parameters, 0 gradients, 15.8 GFLOPs - -PyTorch: starting from /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.pt with output shape (1, 25200, 9) (13.8 MB) - -TorchScript: starting export with torch 1.8.0+cu111... -TorchScript: export success ✅ 0.8s, saved as /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.torchscript (27.3 MB) - -ONNX: starting export with onnx 1.12.0... -ONNX: export success ✅ 1.6s, saved as /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx (27.2 MB) - -Export complete (2.6s) -Results saved to /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights -Detect: python detect.py --weights /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx -Validate: python val.py --weights /mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx -PyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'custom', '/mnt/sdc/aicheck/IntelligentizeAI/data_set/weights/ces2_193120735164768256_R-ODY_2_640.onnx') -Visualize: https://netron.app -192.168.0.20 - - [2022-11-24 08:59:17] "GET /api/start_download_pt?param=%5B%7B%22index%22%3A+0%2C+%22name%22%3A+%22exp_inputPath%22%2C+%22value%22%3A+%22%2Fmnt%2Fsdc%2Faicheck%2FIntelligentizeAI%2Fdata_set%2Fweights%2Fces2_193120735164768256_R-ODY_2_640.pt%22%2C+%22description%22%3A+%22%5Cu8f6c%5Cu5316%5Cu6a21%5Cu578b%5Cu8f93%5Cu5165%5Cu8def%5Cu5f84%22%2C+%22default%22%3A+%22E%3A%2Falg_demo-master%2Falg_demo%2Fapp%2Fyolov5%2F%5Cu5706%5Cu5b54_123_RODY_1_640.pt%2F%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+1%2C+%22name%22%3A+%22device%22%2C+%22value%22%3A+%22gpu%22%2C+%22description%22%3A+%22CPU%5Cu6216GPU%22%2C+%22default%22%3A+%22gpu%22%2C+%22type%22%3A+%22S%22%2C+%22show%22%3A+false%7D%2C+%7B%22index%22%3A+2%2C+%22name%22%3A+%22imgsz%22%2C+%22value%22%3A+640%2C+%22description%22%3A+%22%5Cu56fe%5Cu50cf%5Cu5927%5Cu5c0f%22%2C+%22default%22%3A+640%2C+%22type%22%3A+%22I%22%2C+%22show%22%3A+true%7D%5D&id=875 HTTP/1.1" 200 240 2.709875 + from n params module arguments + 0 -1 1 3520 app.yolov5.models.common.Conv [3, 32, 6, 2, 2] + 1 -1 1 18560 app.yolov5.models.common.Conv [32, 64, 3, 2] + 2 -1 1 18816 app.yolov5.models.common.C3 [64, 64, 1] + 3 -1 1 73984 app.yolov5.models.common.Conv [64, 128, 3, 2] + 4 -1 2 115712 app.yolov5.models.common.C3 [128, 128, 2] + 5 -1 1 295424 app.yolov5.models.common.Conv [128, 256, 3, 2] + 6 -1 3 625152 app.yolov5.models.common.C3 [256, 256, 3] + 7 -1 1 1180672 app.yolov5.models.common.Conv [256, 512, 3, 2] + 8 -1 1 1182720 app.yolov5.models.common.C3 [512, 512, 1] + 9 -1 1 656896 app.yolov5.models.common.SPPF [512, 512, 5] + 10 -1 1 131584 app.yolov5.models.common.Conv [512, 256, 1, 1] + 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] + 12 [-1, 6] 1 0 app.yolov5.models.common.Concat [1] + 13 -1 1 361984 app.yolov5.models.common.C3 [512, 256, 1, False] + 14 -1 1 33024 app.yolov5.models.common.Conv [256, 128, 1, 1] + 15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] + 16 [-1, 4] 1 0 app.yolov5.models.common.Concat [1] + 17 -1 1 90880 app.yolov5.models.common.C3 [256, 128, 1, False] + 18 -1 1 147712 app.yolov5.models.common.Conv [128, 128, 3, 2] + 19 [-1, 14] 1 0 app.yolov5.models.common.Concat [1] + 20 -1 1 296448 app.yolov5.models.common.C3 [256, 256, 1, False] + 21 -1 1 590336 app.yolov5.models.common.Conv [256, 256, 3, 2] + 22 [-1, 10] 1 0 app.yolov5.models.common.Concat [1] + 23 -1 1 1182720 app.yolov5.models.common.C3 [512, 512, 1, False] + 24 [17, 20, 23] 1 51243 app.yolov5.models.yolo.Detect [14, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]] diff --git a/train_log.txt b/train_log.txt new file mode 100644 index 0000000..9482d45 --- /dev/null +++ b/train_log.txt @@ -0,0 +1,27 @@ +nohup: ignoring input +2022-11-28 17:42:23,653 INFO sqlalchemy.engine.Engine select pg_catalog.version() +2022-11-28 17:42:23,653 INFO sqlalchemy.engine.Engine [raw sql] {} +2022-11-28 17:42:23,659 INFO sqlalchemy.engine.Engine select current_schema() +2022-11-28 17:42:23,659 INFO sqlalchemy.engine.Engine [raw sql] {} +2022-11-28 17:42:23,663 INFO sqlalchemy.engine.Engine show standard_conforming_strings +2022-11-28 17:42:23,664 INFO sqlalchemy.engine.Engine [raw sql] {} +2022-11-28 17:42:23,669 INFO sqlalchemy.engine.Engine BEGIN (implicit) +2022-11-28 17:42:23,669 INFO sqlalchemy.engine.Engine COMMIT +Traceback (most recent call last): + File "./app/run.py", line 134, in + server.serve_forever() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/gevent/baseserver.py", line 398, in serve_forever + self.start() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/gevent/baseserver.py", line 336, in start + self.init_socket() + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/gevent/pywsgi.py", line 1545, in init_socket + StreamServer.init_socket(self) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/gevent/server.py", line 180, in init_socket + self.socket = self.get_listener(self.address, self.backlog, self.family) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/gevent/server.py", line 192, in get_listener + return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/gevent/server.py", line 288, in _tcp_listener + sock.bind(address) + File "/home/wd/anaconda3/envs/aicheck_RODY/lib/python3.8/site-packages/gevent/_socketcommon.py", line 563, in bind + return self._sock.bind(address) +OSError: [Errno 98] Address already in use: ('192.168.0.20', 6914)