我在 main.py 裡面定義了許多 argument 參數例如長這樣
然後我的 cmd.sh 長這樣
python main.py --model GaussianCopula \
--input_path data/train_raw.csv \
--output_dir data/ \
--num_rows 1000 \
--save_output \
--gen_dim 23 45 24 99
結果當我執行時
bash cmd.sh
出現 command not found 錯誤
總共有兩個參數找不到
error: unrecognized arguments:
zsh: command not found: --output_dir
zsh: command not found: --save_output
檢查了半天,確認我都有定義這兩個參數
結果我錯誤的原因在這裡,請見下方的圖
可以發現我在 cmd.sh 裡面寫的反斜線換行符號,在第二行跟第四行後面不小心多打了一個空白!!才造成我後面的參數吃不到
把空白刪掉即可解決!
在此筆記一下
cmd.sh 裡面的換行符號 " \ " 後面不可以有空白(space)
要直接換行(newline),避免看不到的錯誤產生!
報告完畢
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing