thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

tiny yolo training error #1080

Open aayushgavande opened 5 years ago

aayushgavande commented 5 years ago

Parsing ./cfg/tiny-yolo-voc.cfg Parsing cfg/tiny-yolo-voc-1c.cfg Loading bin/tiny-yolo-voc.weights ... Successfully identified 63471556 bytes Finished in 0.05065202713012695s

Building net ... Source | Train? | Layer description | Output size -------+--------+----------------------------------+--------------- | | input | (?, 416, 416, 3) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 416, 416, 16) Load | Yep! | maxp 2x2p0_2 | (?, 208, 208, 16) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 208, 208, 32) Load | Yep! | maxp 2x2p0_2 | (?, 104, 104, 32) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 104, 104, 64) Load | Yep! | maxp 2x2p0_2 | (?, 52, 52, 64) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 52, 52, 128) Load | Yep! | maxp 2x2p0_2 | (?, 26, 26, 128) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 26, 26, 256) Load | Yep! | maxp 2x2p0_2 | (?, 13, 13, 256) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 13, 13, 512) Load | Yep! | maxp 2x2p0_1 | (?, 13, 13, 512) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 13, 13, 1024) Load | Yep! | conv 3x3p1_1 +bnorm leaky | (?, 13, 13, 1024) Init | Yep! | conv 1x1p0_1 linear | (?, 13, 13, 30) -------+--------+----------------------------------+--------------- Running entirely on CPU cfg/tiny-yolo-voc-1c.cfg loss hyper-parameters: H = 13 W = 13 box = 5 classes = 1 scales = [1.0, 5.0, 1.0, 1.0] Building cfg/tiny-yolo-voc-1c.cfg loss Building cfg/tiny-yolo-voc-1c.cfg train op Finished in 7.391351699829102s

Enter training ...

cfg/tiny-yolo-voc-1c.cfg parsing newmodel/annotations Parsing for ['Rugby_Ball'] [====================>]100% 000245.xml Statistics: Dataset size: 245 Dataset of 245 instance(s) Traceback (most recent call last): File "flow", line 6, in cliHandler(sys.argv) File "C:\Users\Avinash\Anaconda3\envs\Darkflow\Darkflow_Net\darkflow-master\darkflow\cli.py", line 33, in cliHandler print('Enter training ...'); tfnet.train() File "C:\Users\Avinash\Anaconda3\envs\Darkflow\Darkflow_Net\darkflow-master\darkflow\net\flow.py", line 39, in train for i, (x_batch, datum) in enumerate(batches): File "C:\Users\Avinash\Anaconda3\envs\Darkflow\Darkflow_Net\darkflow-master\darkflow\net\yolo\data.py", line 114, in shuffle inp, new_feed = self._batch(train_instance) File "C:\Users\Avinash\Anaconda3\envs\Darkflow\Darkflow_Net\darkflow-master\darkflow\net\yolov2\data.py", line 27, in _batch img = self.preprocess(path, allobj) File "C:\Users\Avinash\Anaconda3\envs\Darkflow\Darkflow_Net\darkflow-master\darkflow\net\yolo\predict.py", line 62, in preprocess result = imcv2_affine_trans(im) File "C:\Users\Avinash\Anaconda3\envs\Darkflow\Darkflow_Net\darkflow-master\darkflow\utils\im_transform.py", line 20, in imcv2_affine_trans h, w, c = im.shape AttributeError: 'NoneType' object has no attribute 'shape'

how do i solve this error ?

guias12 commented 5 years ago

that's a duplicate https://github.com/thtrieu/darkflow/issues/265#issuecomment-306089270

Tanmay-Kulkarni101 commented 4 years ago

Hey, what command did you use to start the process?

flow --model /content/darkflow/cfg/yolov2-tiny-modified.cfg \
--load /content/darkflow/bin/yolov2-tiny.weights \
--dataset /content/images \
--annotation /content/annotations \
--gpu 1.0 \
--train

worked for me.

Earlier I had made use of the following-

flow --model /content/darkflow/cfg/yolov2-tiny-modified.cfg \
--load /content/darkflow/bin/yolov2-tiny.weights \
--imgdir /content/images \
--annotation /content/annotations \
--gpu 1.0 \
--train

and had faced the same error. Thus, making use of the dataset flag should do the trick. I hope this helps.