Can I train the segmentation branch without training the classification branch? I only require the segmentation part of the script. When I try to do so with two layers false I get the following error:
python3 train_segmentation.py --two_layers=False Training set built. Size: 366467 Traceback (most recent call last): File "/home/user/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1659, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 4 but is rank 2 for 'conv_aux_1/Conv2D' (op: 'Conv2D') with input shapes: [64,2], [3,3,288,512].
My package versions:
numpy 1.16.3
tensorflow 1.13.1 (required me to change some paths when creating the saver in train_classification.py)
scikit-image 0.15.0 (compatible with numpy 1.16.x unlike issue #7 )
pandas 0.23.4
I know these aren't the versions listed in requirements.txt, though I'm currently changing the files to be compatible with python 3.6. This may be the cause for the error, although I doubt this is the case as I have made changes to all dependencies so that they are compatible. And I don't understand why I have less elements in my input matrix just as a result of changing version.
Changes I have made to make it compatible:
changed the open function argument syntax to read binary files.
e.g: from open('train_set_list', 'r') to open('train_set_list.pickle', 'rb')
changed some pathings to the checkpoint file when creating the saver in order include the tower_0 directory:
from:
# Create a saver.
saver = tf.train.Saver(tf.all_variables())
to:
# Create a saver.
code_to_checkpoint_variable_map = {var.op.name: var for var in tf.all_variables()}
for code_variable_name, checkpoint_variable_name in {
"CrossEntropyLoss/value/avg": "tower_0/tower_0/CrossEntropyLoss/value/avg",
"aux_loss/value/avg": "tower_0/tower_0/aux_loss/value/avg",
"total_loss/avg": "tower_0/tower_0/total_loss/avg",
}.items():
code_to_checkpoint_variable_map[checkpoint_variable_name] = code_to_checkpoint_variable_map[
code_variable_name]
del code_to_checkpoint_variable_map[code_variable_name]
saver = tf.train.Saver(code_to_checkpoint_variable_map)
changed for loop syntax from the form:for count in xrange(args) to for count in range(args)
Any help advice would be much appreciated, if I get this working I'll be happy to post a python 3 compatible version of this on github.
Can I train the segmentation branch without training the classification branch? I only require the segmentation part of the script. When I try to do so with two layers false I get the following error:
python3 train_segmentation.py --two_layers=False Training set built. Size: 366467 Traceback (most recent call last): File "/home/user/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1659, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 4 but is rank 2 for 'conv_aux_1/Conv2D' (op: 'Conv2D') with input shapes: [64,2], [3,3,288,512].
My package versions: numpy 1.16.3 tensorflow 1.13.1 (required me to change some paths when creating the saver in train_classification.py) scikit-image 0.15.0 (compatible with numpy 1.16.x unlike issue #7 ) pandas 0.23.4
I know these aren't the versions listed in requirements.txt, though I'm currently changing the files to be compatible with python 3.6. This may be the cause for the error, although I doubt this is the case as I have made changes to all dependencies so that they are compatible. And I don't understand why I have less elements in my input matrix just as a result of changing version.
Changes I have made to make it compatible:
e.g: from
open('train_set_list', 'r')
toopen('train_set_list.pickle', 'rb')
to:
for count in xrange(args)
tofor count in range(args)
Any help advice would be much appreciated, if I get this working I'll be happy to post a python 3 compatible version of this on github.