测试文件
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* 传参:python xxx.py 源文件路径 文件名 /xx/xx/param.json
|
||||
* param.json 包含:
|
||||
* {
|
||||
*
|
||||
* files:[xxx.excel,xxx.excel,xxx.excel],
|
||||
* path: '/xx/xx/xx',//源文件路径
|
||||
* algorithmParam:{
|
||||
algorithm: '多项式拟合',
|
||||
@@ -35,6 +35,18 @@
|
||||
*/
|
||||
'''
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 获取当前脚本(Data_Load.py)所在的目录
|
||||
current_script_dir = os.path.dirname(__file__) # 结果:/home/app/model/ModelTrainingPython/FC_ML_Baseline/FC_ML_Baseline_Data_Handler
|
||||
|
||||
# 从当前目录回退 2 级,得到项目根目录 ModelTrainingPython
|
||||
root_path = os.path.abspath(os.path.join(current_script_dir, "..", ".."))
|
||||
|
||||
# 将根目录添加到 Python 搜索路径
|
||||
sys.path.append(root_path)
|
||||
|
||||
from locale import normalize
|
||||
|
||||
import torch
|
||||
|
||||
Reference in New Issue
Block a user