Closed pgibb96 closed 3 years ago
It's still not quite clear to me why this neuron in particular caused this error but I tracked it down and seem to have fixed it (it's in navis
, not pymaid
). For now, you will need to update navis from Github as I haven't pushed the fix to PyPI yet:
pip3 install git+git://github.com/schlegelp/navis@master
I'm still suspicious as to how this situation occurred in the first place - let me know if you run into more errors with this neuron and I will need to dig a bit deeper.
Thank you! I will let you know if I encounter any other issues.
I no longer have the category issue, but now I have the same issue my lab mate has (TypeError: Object of type int32 is not JSON serializable).
Generating union of all fragments... Done.
Extracting new nodes to upload... Done.
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-1d10d9a890ae> in <module>
----> 1 resp = fafbseg.move.merge_into_catmaid(x, target_instance=manual, tag="wilson_lab", min_node_overlap=4, min_overlap_size=1, merge_limit=.75, min_upload_size=3, min_upload_nodes=1)
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/site-packages/fafbseg/utils.py in wrapper(*args, **kwargs)
35 try:
36 # Execute function
---> 37 res = function(*args, **kwargs)
38 except BaseException:
39 raise
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/site-packages/fafbseg/move/merge.py in merge_into_catmaid(x, target_instance, tag, min_node_overlap, min_overlap_size, merge_limit, min_upload_size, min_upload_nodes, update_radii, import_tags, label_joins, sid_from_nodes, mesh)
446 if update_radii and 'radius' in n.nodes.columns and np.all(n.nodes.radius):
447 print('Updating radii of existing nodes... ', end='', flush=True)
--> 448 resp = update_node_radii(source=n, target=ol,
449 remote_instance=target_instance,
450 limit=merge_limit,
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/site-packages/fafbseg/move/merge.py in update_node_radii(source, target, remote_instance, limit, skip_existing)
529 new_radii = source.nodes.iloc[nn_ix[nn_dist <= limit]].radius.values
530
--> 531 return pymaid.update_radii(dict(zip(tn_ids, new_radii)),
532 remote_instance=remote_instance)
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/site-packages/pymaid/cache.py in wrapper(*args, **kwargs)
175 rm.caching = False
176 # Execute function
--> 177 res = function(*args, **kwargs)
178 # Set caching to old value
179 rm.caching = old_value
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/site-packages/pymaid/upload.py in update_radii(radii, chunk_size, remote_instance)
1533 # We have to explicitly convert the state in a json string because passing
1534 # it to requests as "post" will fuck this up otherwise
-> 1535 update_post['state'] = json.dumps(update_post['state'])
1536
1537 this_resp = remote_instance.fetch(update_radii_url, post=update_post,
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/json/__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
229 cls is None and indent is None and separators is None and
230 default is None and not sort_keys and not kw):
--> 231 return _default_encoder.encode(obj)
232 if cls is None:
233 cls = JSONEncoder
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/json/encoder.py in encode(self, o)
197 # exceptions aren't as detailed. The list call should be roughly
198 # equivalent to the PySequence_Fast that ''.join() would do.
--> 199 chunks = self.iterencode(o, _one_shot=True)
200 if not isinstance(chunks, (list, tuple)):
201 chunks = list(chunks)
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/json/encoder.py in iterencode(self, o, _one_shot)
255 self.key_separator, self.item_separator, self.sort_keys,
256 self.skipkeys, _one_shot)
--> 257 return _iterencode(o, 0)
258
259 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
~/opt/anaconda3/envs/cloudvolume/lib/python3.8/json/encoder.py in default(self, o)
177
178 """
--> 179 raise TypeError(f'Object of type {o.__class__.__name__} '
180 f'is not JSON serializable')
181
TypeError: Object of type int32 is not JSON serializable
The last error should be fixed with f41d1a379a971bab62be971a317b374d099235ed. Try updating to pymaid 2.0.3
and see if the error is gone:
pip3 install python-catmaid -U
Any luck on this @pgibb96 ?
Oh yes, sorry! That fixed the error.
@schlegelp I wanted to move our conversation to GitHub in order to make reading the traceback a bit easier. Currently running fafbseg 1.1.0 and python-catmaid 2.0.2.