[英]How to export result from Unix executable?
我正在從這個出色的圖像質量評估庫中運行深度學習推理:
./predict \
--docker-image nima-cpu \
--base-model-name MobileNet \
--weights-file $(pwd)/models/MobileNet/weights_mobilenet_technical_0.11.hdf5 \
--image-source $(pwd)/src/tests/test_images
運行predict
,這是一個 Unix 可執行文件,返回以下示例輸出:
[
{
"image_id": "42039",
"mean_score_prediction": 5.154480201676051
},
{
"image_id": "42040",
"mean_score_prediction": 4.297615758532629
},
{
"image_id": "42041",
"mean_score_prediction": 5.450399260735139
},
{
"image_id": "42042",
"mean_score_prediction": 5.163813116261736
},
{
"image_id": "42044",
"mean_score_prediction": 5.728919437354534
}
]
我正在嘗試將此輸出保存到 json,但不知道如何保存。 附加--output $(pwd)/src/out.json
或output
任何變體,不會返回任何內容。
Unix exe 是否具有用於導出數據的默認標志? 或者有沒有辦法查看這個exe中的所有標志選項?
看起來 predict 是一個 bash 腳本。 沒有關於參數應該如何工作的規則。 我只是將您的輸出通過管道傳輸到這樣的文件:
./predict \
--docker-image nima-cpu \
--base-model-name MobileNet \
--weights-file $(pwd)/models/MobileNet/weights_mobilenet_technical_0.11.hdf5 \
--image-source $(pwd)/src/tests/test_images
> output.json
最后一部分告訴您的終端將標准輸出(通常會顯示在您的屏幕上)發送到提到的文件,要么創建它,要么覆蓋它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.