finetune_alexnet_with_tensorflow
finetune_alexnet_with_tensorflow copied to clipboard
ValueError: Dimension size must be evenly divisible by 2 but is 1
While I test the scrip of fintune.py on TensorFlow 1.5, the system throws the errorn as follows. I list the information inlucuding ValueError, possible questionable code and traceback as follows. Appreciate your help in advance.
1. General Message
ValueError: Dimension size must be evenly divisible by 2 but is 1 Number of ways to split should evenly divide the split dimension for 'split_1' (op: 'Split') with input shapes: [], [5,5,2,1] and with computed input
2. Code
It targets to the line of code as follows.
alexnet.py
weight_groups = tf.split(value=weights, num_or_size_splits=group, axis=3)
3. Detailed Error Message:
$ python finetune.py --conv=4 --dropout_rate=0.03
Traceback (most recent call last): File "/home/nano/.virtualenvs/win/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1607, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension size must be evenly divisible by 2 but is 1 Number of ways to split should evenly divide the split dimension for 'split_1' (op: 'Split') with input shapes: [], [5,5,2,1] and with computed input tensors: input[0] = <3>.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "finetune.py", line 97, in