Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watershed Distance Transform for 2D Data not working #120

Closed
riederd opened this issue Dec 4, 2018 · 2 comments · Fixed by #109
Closed

Watershed Distance Transform for 2D Data not working #120

riederd opened this issue Dec 4, 2018 · 2 comments · Fixed by #109

Comments

@riederd
Copy link

riederd commented Dec 4, 2018

Hi,

I'm tryining to run deepcell-tf using the "Watershed Distance Transform for 2D Data" notebook as python script on some of our images. For now I'm only using 2 sets of nuclear stain images each set has 1 image. However, unfortunately it seems not to work as expected.

After training the foreground/background separation model it crashes at step [5] and produces the following traceback:

Traceback (most recent call last):
File "runDeepCellWatershedSeq.py", line 158, in
shear=False)
File "/home/foo/miniconda3/envs/deepCell-tf/lib/python3.6/site-packages/DeepCell-0.1-py3.6.egg/deepcell/training.py", line 169, in train_model_sample
File "/home/foo/miniconda3/envs/deepCell-tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1761, in fit_generator
initial_epoch=initial_epoch)
File "/home/foo/miniconda3/envs/deepCell-tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_generator.py", line 190, in fit_generator
x, y, sample_weight=sample_weight, class_weight=class_weight)
File "/home/foo/miniconda3/envs/deepCell-tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1537, in train_on_batch
outputs = self.train_function(ins)
File "/home/foo/miniconda3/envs/deepCell-tf/lib/python3.6/site-packages/tensorflow/python/keras/backend.py", line 2897, in call
fetched = self._callable_fn(*array_vals)
File "/home/foo/miniconda3/envs/deepCell-tf/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1454, in call
self._session._session, self._handle, args, status, None)
File "/home/foo/miniconda3/envs/deepCell-tf/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [10,2] vs. [10,4]
[[Node: loss_1/softmax_1_loss/mul_1 = Mul[T=DT_FLOAT, _class=["loc:@training_1/SGD/gradients/loss_1/softmax_1_loss/mul_1_grad/Reshape_1"], _device="/job:localhost/replica:0/task:0/device:GPU:0"](_arg_softmax_1_target_0_1/_1259, loss_1/softmax_1_loss/Log)]]
[[Node: training_1/SGD/gradients/batch_normalization_15/cond/FusedBatchNorm_1_grad/FusedBatchNormGrad/_1481 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_1300_...chNormGrad", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"

The problem seems to be: Incompatible shapes: [10,2] vs. [10,4]

How can this be fixed?

@willgraf
Copy link
Contributor

willgraf commented Dec 4, 2018

It would be helpful if you could you post the code you're running to get this error. I think I've run into this error before, but seeing the exact code would really help diagnose.

@riederd
Copy link
Author

riederd commented Dec 5, 2018

Sure,

I attached a zipped python script.
Thanks for looking at this.

DeepCellWatershedSeq.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants