caffe訓練自己的資料時的錯誤

2021-08-07 05:33:08 字數 2349 閱讀 4913

root@wzy-ubuntu:/home/wzy/caffe-master# sh examples/wzy/create_meanfile.sh 

f0821 16:03:04.561220 17469 db_lmdb.hpp:15] check failed: mdb_status == 0 (2 vs. 0) no such file or directory

*** check failure stack trace: ***

@ 0x7fa03e8175cd google::logmessage::fail()

@ 0x7fa03e819433 google::logmessage::sendtolog()

@ 0x7fa03e81715b google::logmessage::flush()

@ 0x7fa03e819e1e google::logmessagefatal::~logmessagefatal()

@ 0x7fa03ec33dd8 caffe::db::lmdb::open()

@ 0x402185 main

@ 0x7fa03d788830 __libc_start_main

@ 0x402bb9 _start

@ (nil) (unknown)

examples/wzy/create_meanfile.sh: 行 5: 17469 已放棄 (核心已轉儲) $tools/compute_image_mean $example/ilsvrc12_train_lmdb $data/imagenet_mean.binaryproto

done.

其中create_meanfile.sh內容為:

example=examples/wzy

data=examples/wzy

tools=build/tools

$tools/compute_image_mean $example/ilsvrc12_train_lmdb $data/imagenet_mean.binaryproto

echo "done."

原因是create_wzynet.sh中

$example/ilsvrc12_train_lmdb
這一行後面有多餘的"#生成的lmdb路徑行"注釋,去掉注釋時,留下了一些空格,

導致建立的ilsvrc12_train_lmdb 目錄後面也有空格,因此執行create_meanfile.sh時就找不到這個目錄了

create_wzynet.sh內容:

example=examples/wzy/

data=examples/wzy/data/

tools=build/tools

train_data_root=/

val_data_root=/

# 這裡我們開啟resize,需要把所有尺寸統一

resize=true

if $resize; then

resize_height=256

resize_width=256

else

resize_height=0

resize_width=0

fi.......

echo "creating train lmdb..."

#生成的lmdb路徑

glog_logtostderr=1 $tools/convert_imageset \

--resize_height=$resize_height \

--resize_width=$resize_width \

--shuffle \

$train_data_root \

$data/train.txt \

$example/ilsvrc12_train_lmdb

echo "creating val lmdb..."

#生成的lmdb路徑

glog_logtostderr=1 $tools/convert_imageset \

--resize_height=$resize_height \

--resize_width=$resize_width \

--shuffle \

$val_data_root \

$data/val.txt \

$example/ilsvrc12_val_lmdb

echo "done."

參考這個:

caffe訓練自己的資料

本文介紹如何使用 caffe 對自己的影象資料進行分類。1 資料庫準備 由於資料收集比較費時,為了簡單說明,我用了兩類,dog和 bird 每種約 300張。train200 張,val100張。新建乙個資料夾 mine 放自己的資料,在 mine 資料夾下新建 train 和val 資料夾,tra...

使用caffe訓練自己的資料

這裡先介紹採用image net來訓練自己的資料 假設放在 data train 假設放在 data val 格式樣例 格式樣例 假設這兩個檔案均放在 data 這裡將資料最好放在自己的使用者組裡面,放在別的使用者組,在呼叫image net的時候可能會涉及到許可權問題導致執行失敗。example ...

Caffe 用自己的資料做訓練

1.1資料集分為train和validate,分別寫到train.txt和val.txt中。1.2將準備好的兩個txt,放到caffe root data myfile caffe root是caffe的根目錄,myfile自己命名 將訓練街和驗證集資料夾放到 img full dir1和 img ...