Problem with RelateObjects


I have a problem in CellProfiler 3.1.8 where I built again my pipeline that used to work well in CellProfiler 2.2. In CellProfiler 3 the pipeline is not able to relate the identified objects. It gives an error message saying: Error while processing RelateObjects: (Worker) KeyError: u’None’.
Any ideas of what is wrong?


It sounds like the setting for which object set to relate is missing. If you head back into the RelateObjects module, are the parent/child objects listed correctly? If so, could you send a screenshot?

Hi David,

Thank you for your reply. I think the parent/child objects are listen correctly. I attached screenshots to this email. Another problem is that when I open the pipeline there is an extra parent added in the module with the selection ’None’. I remove
this before I hit the analyze all button though.



Thanks, it looks like the settings are being imported incorrectly then, they’re coming from a very old version of CellProfiler. Could you try just adding a new copy of the RelateObjects module and copying the correct settings over, then deleting the bugged one?

I also tried building the whole pipeline again module by module with the correct settings, but I still face the same problem.

Hi Lauri. Have you been able to solve your issue? I’ve encountered the same issue with CellProfiler 4.0.7. I was given the same error code (Error while processing RelateObjects:
(Worker) KeyError: ‘None’) when trying to relate objects. I’ve attached a screen shot. My parent-child structure is very similar to yours - looks like we want to get similar measurements.

Hi @oliviama,

Was this pipeline also coming from an earlier version of CellProfiler?

It might help if you could upload a copy of the problem pipeline and image set.


Hi David,
thanks for your response. The pipleline has originally been built in an earlier version (3.1.9 MacOS) and different people/students have added to it on their computers and different versions. The module Relate object has been added most recently on version 4.0.7.
I’ve attached the pipeline and an image set.
Lamp1-488 Phallo-546 Dapi.lif_Borc-10_ch00.tif (2.4 MB) Lamp1-488 Phallo-546 Dapi.lif_Borc-10_ch01.tif (2.9 MB) Lamp1-488 Phallo-546 Dapi.lif_Borc-10_ch02.tif (4.3 MB)
pipeline_distances Hela_v1.cppipe (17.3 KB)

Hi @oliviama,

Thanks for that, I think I’ve found the bug causing this and have put together a fix which should be in the next version. For now the workaround is to remove any unwanted extra object sets each time you load the pipeline, hope that’s not too much trouble.

Hi David,

thanks for identifying the bug and incorporating a fix into the next version.
Could you please be more specific for me about the workaround: which extra object sets are you referring to that need to be removed when loading the pipeline? under which module and step do I find these extra object sets? screenshots could help as well.
Thank you so much. Olivia

In one of the screenshots above you can see that the RelateObjects module added 2 extra object sets (circled). If you can’t find those on your version, perhaps try removing and re-creating that module.

Hi David,
I could locate the two extra object sets that show up in the RelateObject module when loading the pipeline. I removed them (screenshot) and loaded my image set. Still, I receive the same error when the pipeline arrives at the RelateObject module (screenshot). Is there another work-around I could try? Just removing the extra object sets does not do it.
Thanks, Olivia!
Screenshot 2021-02-19 at 11.13.14|690x300

Hi @oliviama,

It’s possible that the extra objects are being regenerated during the analysis run, unless this is happening in Test Mode? The ‘easy’ fix for now would be to disable “measure distances to other parents” option.