CovertLab/DeepCell

running_template.py broken?

Closed this issue · 2 comments

Great work.

Though when I do the running template for HeLa. The following code:

cytoplasm_predictions = run_models_on_directory(data_location, cyto_channel_names, cyto_location, model_fn = cyto_fn, 
    list_of_weights = list_of_cyto_weights, image_size_x = image_size_x, image_size_y = image_size_y, 
    win_x = win_cyto, win_y = win_cyto, std = False, split = False)

leads to the following runtime error:

theano.tensor.var.AsTensorError: ('Cannot convert Tensor("sparse_convolution2d_1_W/read:0", shape=(3, 3, 280, 64), dtype=float32) to TensorType', <class 'tensorflow.python.ops.variables.Variable'>)

Is there anything about the dimensionality I need to fix? Thanks.

Thanks. Is running_template.py the first script I should play with to test things are working? I wanted to check I'm coming to your code from the right entrance. I'm using the code from here (https://covertlab.github.io/DeepCell/running_convnets.html)

I changed the backend and now I am getting:

 model = model_fn(batch_input_shape = batch_input_shape, n_features = n_features, weights_path = list_of_weights[0])
>> model.add(sparse_Convolution2D(64, 3, 3, d = d, init = init, batch_input_shape = batch_input_shape, border_mode='valid', W_regularizer = l2(reg)))
...
Exception: Invalid dim_ordering: tf

Weights are as follows:

Out[8]: 
['/Users/usr/Desktop/DeepCell/trained_networks/Nuclear/2016-07-12_nuclei_all_61x61_bn_feature_net_61x61_0.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/Nuclear/2016-07-12_nuclei_all_61x61_bn_feature_net_61x61_1.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/Nuclear/2016-07-12_nuclei_all_61x61_bn_feature_net_61x61_2.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/Nuclear/2016-07-12_nuclei_all_61x61_bn_feature_net_61x61_3.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/Nuclear/2016-07-12_nuclei_all_61x61_bn_feature_net_61x61_4.h5']

In [9]: list_of_cyto_weights
Out[9]: 
['/Users/usr/Desktop/DeepCell/trained_networks/HeLa/2016-07-12_HeLa_all_61x61_bn_feature_net_61x61_0.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/HeLa/2016-07-12_HeLa_all_61x61_bn_feature_net_61x61_1.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/HeLa/2016-07-12_HeLa_all_61x61_bn_feature_net_61x61_2.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/HeLa/2016-07-12_HeLa_all_61x61_bn_feature_net_61x61_3.h5',
 '/Users/usr/Desktop/DeepCell/trained_networks/HeLa/2016-07-12_HeLa_all_61x61_bn_feature_net_61x61_4.h5']