pudae / tensorflow-densenet

Tensorflow-DenseNet with ImageNet Pretrained Models
Apache License 2.0
169 stars 59 forks source link

Cant run/train on mnist data #16

Open tanmay-badhe opened 6 years ago

tanmay-badhe commented 6 years ago

I understand that MNIST is a grayscale image so how to make this code work with GrayScale images, it works fine with RGB images

$python train_image_classifier.py --train_dir=${TRAIN_DIR} --dataset_name=mnist --dataset_split_name=train --dataset_dir=${DATASET_DIR} --model_name=densenet121

normal output: InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [1,1,1024,10] rhs shape= [1,1,1024,5] [[Node: save/Assign_1299 = Assign[T=DT_FLOAT, _class=["loc:@densenet121/logits/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](densenet121/logits/weights/RMSProp, save/RestoreV2/_7)]]

after editing preprocessing output: InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [7,7,1,64] rhs shape= [7,7,3,64] [[Node: save/Assign_8 = Assign[T=DT_FLOAT, _class=["loc:@densenet121/conv1/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](densenet121/conv1/weights, save/RestoreV2/_2667)]]