tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.5k stars 3.49k forks source link

About the image transformer #1241

Open ZainySong opened 5 years ago

ZainySong commented 5 years ago

Description

Why cannot I train the model by the imagetransformer?

The command code:

pip install tensor2tensor

PROBLEM=image_cifar10_plain_gen MODEL=imagetransformer HPARAMS=imagetransformer_cifar10_base

DATA_DIR=$HOME/t2t_data TMP_DIR=/tmp/t2t_datagen TRAIN_DIR=$HOME/t2t_train/$PROBLEM/$MODEL-$HPARAMS

mkdir -p $DATA_DIR $TMP_DIR $TRAIN_DIR

t2t-datagen \ --data_dir=$DATA_DIR \ --tmp_dir=$TMP_DIR \ --problem=$PROBLEM

t2t-trainer \ --data_dir=$DATA_DIR \ --problem=$PROBLEM \ --model=$MODEL \ --hparams_set=$HPARAMS \ --output_dir=$TRAIN_DIR

The error:

ValueError: Dimension size must be evenly divisible by 3 but is 1 Number of ways to split should evenly divide the split dimension for 'imagetransformer/parallel_0_4/imagetransformer/imagetransformer/body/split' (op: 'Split') with input shapes: [], [?,1,1,1] and with computed input tensors: input[0] = <3>.

Can anyone tell me why the problem happened? Thanks so much.

ZainySong commented 5 years ago

Sorry everyone. I have known and be able to train the model in MODEL=imagetransformer2d, but still cannot train it in the MODEL=imagetransformer, can anyone help me to solve the problem?