Customize Dataset
電腦環境 : Win10 、mmcv-full版本 : 1.5.0、torch 版本 : 1.12.1
按照Tutorial 3 : Customize Dataset其中的 2.The sample images are arranged in the special structure: 操作,欲將自己的資料集新增進去,並且訓練模型。
以下是新增的程式碼檔案
新增以後執行以下指令開始訓練模型:
python tools/train.py configs/regnet/regnetx-400mf_8xb128_in1k.py
出現以下錯誤訊息:
錯誤訊息 : ValueError: CustomDataset: not enough values to unpack (expected 2, got 1)
嘗試了下列幾種方法都沒辦法成功Debug。
1. 去Data裡面刪資料
2. 在程式碼裡面刪除一個回傳的參數
3. 欲在程式碼裡面新稱一個參數讓它可以接收,卻不知道該從哪裡新增。
請問該如何解決?
以下幾點想詢問
1. 上面第一張圖裡面紅線標註地方提到 : And in your config file, you can modify the data
field as below:
那段程式碼在許多py檔裡面都有出現,請問是要修改哪一個? 或是要自己新增一段?(目前採用此法)
2. Tutorial 3 : Customize Dataset 裡面提到三種方法 :
1. 將自有的資料集分類好新增到mmclassification底下後直接修改configs檔案
2. 新增Filelist來加載數據
3. Use dataset wrapper
請問是三種方法選擇一種做 ? 還是三種方法是連貫的,都需要做 ?
The discussion has been closed due to inactivity. To continue with the topic, please feel free to post a new discussion.
Comments
@Chen-Pocky
Hi Pocky,
我想您可能看錯參考連結了,因為您使用的是 mmclassification (請參考以下連結):
https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/new_dataset.md (customize_dataset.md)
使用 customize_dataset 這裡只有兩種方法 :
1. Use your own dataset
2. Use dataset wrapper
kneron-mmclassification step by step (regnet_step_by_step) 連結參考位置:
https://github.com/kneron/kneron-mmclassification/blob/main/docs_kneron/regnet_step_by_step.md
抱歉這麼慢才回覆,我所參考的聯結與您提供的聯結一模一樣,是同一個聯結。您提供的方法一 Use your own dataset中的兩種方法,我也都依照參考聯結的方法做過了,才出現以上我所提到的錯誤。
我已經透過colab解決將自己的Dataset放進模型去訓練的問題,現在有新的問題,就是latest.pth檔轉成"onnx檔時發生的幾個錯誤,完全整理完後再上來提問,感謝!