Closed mi2celis closed 2 years ago
Confirmed. Looking into this now.
The bug was in one of fathomnet-py's dependencies: coco-lib; images with missing timestamps were failing to serialize into the COCO format.
Fixed in coco-lib v0.1.2 and fathomnet-py v0.5.0.
Tested with command:
fathomnet-generate --concepts "Sebastes,Anoplopoma fimbria,Sebastolobus,Dosidicus gigas,Gonatus onyx,Chiroteuthis calyx,Nanomia bijuga" --format coco -o test_dataset -v
How do I update to coco-lib v0.1.2 andf athomnet-py v0.5.0 Will a simple pip install pull the updated versions?
Yes, running:
pip install --upgrade fathomnet
will upgrade both.
Ran into a different problem after upgrading:
$ fathomnet-generate --concepts "Sebastes,Anoplopoma fimbria,Sebastolobus,Dosidicus gigas,Gonatus onyx,Chiroteuthis calyx,Nanomia bijuga" --format coco -o fish_squid_species
Traceback (most recent call last):
File "/home/mimi/.local/bin/fathomnet-generate", line 7, in
Fixed in v0.5.1. This bug was present only in Python 3.7.
Everything is working now. Thank you!
I am trying to download COCO annotations for certain species using fathomnet-generate.
For certain species, I have no errors, e.g. fathomnet-generate -c "Sebastes auriculatus" --format coco -o Sebastes_auriculatus
However, for others I have tried (Sebastes, Anoplopoma fimbria, Sebastolobus, Dosidicus gigas, Gonatus onyx, Chiroteuthis calyx, Nanomia bijuga) I get errors.
For example: $ fathomnet-generate -c "Sebastes" --format coco -o Sebastes Traceback (most recent call last): File "/home/mimi/.local/bin/fathomnet-generate", line 11, in
sys.exit(main())
File "/home/mimi/.local/lib/python3.7/site-packages/fathomnet/scripts/fathomnet_generate.py", line 426, in main
error = generate_dataset(args, dataset_images) # Generate the dataset
File "/home/mimi/.local/lib/python3.7/site-packages/fathomnet/scripts/fathomnet_generate.py", line 234, in generate_dataset
return dataset_func[args.format](ims, args.output)
File "/home/mimi/.local/lib/python3.7/site-packages/fathomnet/scripts/fathomnet_generate.py", line 218, in generate_coco_dataset
coco_dataset.save(output_path, indent=2)
File "/home/mimi/.local/lib/python3.7/site-packages/coco_lib/bases.py", line 21, in save
f.write(self.to_json(**kwargs))
File "/home/mimi/.local/lib/python3.7/site-packages/dataclasses_json/api.py", line 49, in to_json
return json.dumps(self.to_dict(encode_json=False),
File "/home/mimi/.local/lib/python3.7/site-packages/dataclasses_json/api.py", line 85, in to_dict
return _asdict(self, encode_json=encode_json)
File "/home/mimi/.local/lib/python3.7/site-packages/dataclasses_json/core.py", line 340, in _asdict
encode_json=encode_json
File "/home/mimi/.local/lib/python3.7/site-packages/dataclasses_json/core.py", line 354, in _asdict
return list(_asdict(v, encode_json=encode_json) for v in obj)
File "/home/mimi/.local/lib/python3.7/site-packages/dataclasses_json/core.py", line 354, in
return list(_asdict(v, encode_json=encode_json) for v in obj)
File "/home/mimi/.local/lib/python3.7/site-packages/dataclasses_json/core.py", line 347, in _asdict
encode_json=encode_json)
File "/home/mimi/.local/lib/python3.7/site-packages/dataclasses_json/core.py", line 110, in _encode_overrides
v = encoder(v) if encoder is not None else v
File "/home/mimi/.local/lib/python3.7/site-packages/coco_lib/common.py", line 37, in
encoder=lambda d: d.strftime('%Y-%m-%d %H:%M:%S'),
AttributeError: 'NoneType' object has no attribute 'strftime'
Any suggestions?