冲突排查
This commit is contained in:
41
main.py
41
main.py
@@ -1,48 +1,25 @@
|
|||||||
# import logging.config
|
|
||||||
# import os
|
|
||||||
# import traceback
|
|
||||||
#
|
|
||||||
# from config.photo_review import RETRY_TIME, SEND_ERROR_EMAIL, CUDA_VISIBLE_DEVICES
|
|
||||||
#
|
|
||||||
# os.environ["CUDA_VISIBLE_DEVICES"] = CUDA_VISIBLE_DEVICES
|
|
||||||
#
|
|
||||||
# import paddle
|
|
||||||
# from auto_email.error_email import send_an_error_email
|
|
||||||
# from config.log import LOGGING_CONFIG
|
|
||||||
# from photo_review.photo_review import main
|
|
||||||
#
|
|
||||||
# # 项目必须从此处启动,否则代码中的相对路径可能导致错误的发生
|
|
||||||
# if __name__ == '__main__':
|
|
||||||
# logging.config.dictConfig(LOGGING_CONFIG)
|
|
||||||
# log = logging.getLogger()
|
|
||||||
#
|
|
||||||
# # 崩溃后的重试次数
|
|
||||||
# for _ in range(RETRY_TIME + 1):
|
|
||||||
# try:
|
|
||||||
# log.info("【照片审核关键信息抽取】开始")
|
|
||||||
# main()
|
|
||||||
# except Exception as e:
|
|
||||||
# log.error(traceback.format_exc())
|
|
||||||
# if SEND_ERROR_EMAIL:
|
|
||||||
# send_an_error_email(program_name='照片审核关键信息抽取脚本', error_name=repr(e), error_detail=traceback.format_exc())
|
|
||||||
# # 释放显存
|
|
||||||
# paddle.device.cuda.empty_cache()
|
|
||||||
import logging.config
|
import logging.config
|
||||||
|
import os
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
import paddle
|
from config.photo_review import RETRY_TIME, SEND_ERROR_EMAIL, CUDA_VISIBLE_DEVICES
|
||||||
|
|
||||||
|
os.environ["CUDA_VISIBLE_DEVICES"] = CUDA_VISIBLE_DEVICES
|
||||||
|
|
||||||
|
import paddle
|
||||||
from auto_email.error_email import send_an_error_email
|
from auto_email.error_email import send_an_error_email
|
||||||
from config.log import LOGGING_CONFIG
|
from config.log import LOGGING_CONFIG
|
||||||
from config.photo_review import SEND_ERROR_EMAIL
|
|
||||||
from photo_review import photo_review
|
from photo_review import photo_review
|
||||||
|
|
||||||
|
# 项目必须从此处启动,否则代码中的相对路径可能导致错误的发生
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
logging.config.dictConfig(LOGGING_CONFIG)
|
logging.config.dictConfig(LOGGING_CONFIG)
|
||||||
log = logging.getLogger()
|
log = logging.getLogger()
|
||||||
|
|
||||||
|
# 崩溃后的重试次数
|
||||||
|
for _ in range(RETRY_TIME + 1):
|
||||||
try:
|
try:
|
||||||
log.info("【照片审核关键信息抽取】开始")
|
# log.info("【照片审核关键信息抽取】开始")
|
||||||
photo_review.main()
|
photo_review.main()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(traceback.format_exc())
|
log.error(traceback.format_exc())
|
||||||
|
|||||||
Reference in New Issue
Block a user