在subprocess.py中,Model_exec失败

时间:2017-10-23 22:25:04

标签: python optimization

亲爱的Dakota和python用户,

我使用的是Windows 8.1,Sandia的Dakota GUI版本6.6和Python 2.7.14(正如Dakota建议的那样 - https://dakota.sandia.gov/content/latest-gui-manual)。在首选项中,我设置了Dakota可执行文件的路径和python解释器的路径。教程中的悬臂情况正常运行 - 作为中心参数研究。可以在cmd中检测到Dakota和python可执行文件(作为响应,我得到了程序的版本)。

我想使用T-Axi外部代码(http://gtsl.ase.uc.edu/T-AXI/)运行案例。我设置了模拟模型(模型可执行文件的路径和输入和输出文件中的参数),Dakota研究(我设置遗传算法 - coliny_ea,变量作为连续设计和连续状态,下限和上限与模型响应)和分析驱动程序(我设置)模拟模型和达科他研究 - 变量和响应)。

当我尝试进行达科他研究时,我遇到了这样的问题:

Dakota reported: Traceback (most recent call last):
  File "C:\Users\XXX\Documents\Dakota_projects\dakota_project2_files\drivers\script_python.py", line 367, in <module>
    model_exec = subprocess.Popen(shlex.split(model_exec_args), stdout=PIPE, stderr=PIPE)
  File "C:\Python27\lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
    startupinfo)
WindowsError: [Error 2] Couldn’t file specified file

Dakota的输入文件是:

interface
    analysis_drivers 'python -m script_python'
        fork
            parameters_file 'params.in'
            results_file 'results.out'
            file_tag
            file_save
    asynchronous
        evaluation_concurrency 4
responses
descriptors 'efficiency'
objective_functions 1
    sense 'max'
    primary_scale_types 'none'
no_gradients
no_hessians
method
coliny_ea
    population_size 10
    fitness_type
        merit_function
    crossover_rate 1
    crossover_type
        two_point
    mutation_rate 1
    seed 11011011
    max_iterations 100
    convergence_tolerance 0.001
    max_function_evaluations 100
    model_pointer 'tcdes'
model
id_model 'tcdes'
single
environment
tabular_data
    tabular_data_file 'tabular_graphics.out'
output_file 'dakota.out'
error_file 'dakota.err'
write_restart 'dakota.rst'
results_output
    results_output_file 'results.out'
variables
    continuous_design 7
        initial_point 0.2047 0.212 11.9452 1.4 3000 1.4 1.2001
        lower_bounds 0 0 1 .5 500 .5 0
        upper_bounds .5 .5 20 5 5000 5 5
        scale_types 'none' 'none' 'none' 'none' 'none' 'none' 'none'
        descriptors 'mach1' 'mach3' 'mass' 'rotor_aspect' 'rpm' 'stator_aspect' 'temperature_rise'

在python脚本文件中,第119行如下:

model_exec_args = "tcdes APc"

在python脚本文件中,第376行如下:

model_exec = subprocess.Popen(shlex.split(model_exec_args), stdout=PIPE, stderr=PIPE)

在位于DakotaStudy文件夹的错误文件中,我有这样的评论:

Error: cannot open results file "results.out.1" for evaluation 1

在位于DakotaStudy文件夹的out文件的最后几行中,我有这样的评论:

(Asynchronous job 4 added to queue)

    Blocking synchronize of 4 asynchronous evaluations
    First pass: initiating 4 local asynchronous jobs
    Initiating evaluation 1
    nonblocking fork: python -m script_python params.in.1 results.out.1
    Initiating evaluation 2
    nonblocking fork: python -m script_python params.in.2 results.out.2
    Initiating evaluation 3
    nonblocking fork: python -m script_python params.in.3 results.out.3
    Initiating evaluation 4
    nonblocking fork: python -m script_python params.in.4 results.out.4
    Waiting on completed jobs

你知道如何解决这个问题吗?

祝你好运

0 个答案:

没有答案