diff --git a/frameworks/MLNet/exec.py b/frameworks/MLNet/exec.py index 0dbdb86a5..4ae2d214a 100644 --- a/frameworks/MLNet/exec.py +++ b/frameworks/MLNet/exec.py @@ -55,12 +55,19 @@ def run(dataset: Dataset, config: TaskConfig): log.info(f'test dataset: {test_dataset_path}') cmd = (f"{mlnet} {sub_command}" - f" --dataset {train_dataset_path} --test-dataset {test_dataset_path} --train-time {train_time_in_seconds}" + f" --dataset {train_dataset_path} --train-time {train_time_in_seconds}" f" --label-col {label} --output {os.path.dirname(output_dir)} --name {config.fold}" - f" --verbosity q --log-file-path {log_path}") + f" --verbosity diag --log-file-path {log_path}") with Timer() as training: - run_cmd(cmd) + try: + run_cmd(cmd, _live_output_='line') + except Exception as e: + log.error(e, exc_info=e) + with open(log_path, 'r') as f: + for line in f: + log.info(line) + raise train_result_json = os.path.join(output_dir, '{}.mbconfig'.format(config.fold)) if not os.path.exists(train_result_json): diff --git a/frameworks/MLNet/setup.sh b/frameworks/MLNet/setup.sh index e19b1b7ca..78e86b25e 100755 --- a/frameworks/MLNet/setup.sh +++ b/frameworks/MLNet/setup.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash HERE=$(dirname "$0") -MLNET='mlnet' +MLNET_PACKAGE='mlnet-linux-x64' VERSION=${1:-"latest"} DOTNET_INSTALL_DIR="$HERE/lib" MLNET="$DOTNET_INSTALL_DIR/mlnet" DOTNET="$DOTNET_INSTALL_DIR/dotnet" -SOURCE="https://mlnetcli.blob.core.windows.net/mlnetcli/index.json" +SOURCE="https://api.nuget.org/v3/index.json" export DOTNET_CLI_HOME="$DOTNET_INSTALL_DIR" @@ -21,13 +21,16 @@ if [[ ! -x "$MLNET" ]]; then if [[ ! -x "$DOTNET" ]]; then wget -P "$DOTNET_INSTALL_DIR" https://dot.net/v1/dotnet-install.sh chmod +x "$DOTNET_INSTALL_DIR/dotnet-install.sh" - "$DOTNET_INSTALL_DIR/dotnet-install.sh" -c Current --install-dir "$DOTNET_INSTALL_DIR" -Channel 3.1 --verbose + "$DOTNET_INSTALL_DIR/dotnet-install.sh" -c Current --install-dir "$DOTNET_INSTALL_DIR" -Channel 6.0 --verbose fi - $DOTNET tool install mlnet --add-source "$SOURCE" --version "$VERSION" --tool-path "$DOTNET_INSTALL_DIR" + $DOTNET tool install $MLNET_PACKAGE --add-source "$SOURCE" --version "$VERSION" --tool-path "$DOTNET_INSTALL_DIR" else - $DOTNET tool update mlnet --add-source "$SOURCE" --version "$VERSION" --tool-path "$DOTNET_INSTALL_DIR" + $DOTNET tool update $MLNET_PACKAGE --add-source "$SOURCE" --version "$VERSION" --tool-path "$DOTNET_INSTALL_DIR" fi export DOTNET_ROOT="$DOTNET_INSTALL_DIR" +# enable predict command in mlnet +export MLNetCLIEnablePredict=True + $MLNET --version | grep + | sed -e "s/\(.?*\)+.*/\1/" >> "${HERE}/.setup/installed"