-
Notifications
You must be signed in to change notification settings - Fork 210
Python 3.7 --- model prediction and object detection #979
Comments
Hi @gianscarpe thanks for reporting this! I thought this should have been fixed following #857 - could you share a reproducible script which gives the error? |
I can reproduce the error. installation via: use the example program from https://lightning-flash.readthedocs.io/en/latest/reference/object_detection.html
|
Got same error with that code, any workaround using |
Hey all, this issue should now be fixed as we now only support prediction via a Trainer with a datamodule where this error shouldn't occur. Closing this, but please feel free to re-open if needed 😃 |
🐛 Bug
I got this error
~/.local/share/virtualenvs/cell_instance_segm-TWYpWSyU/lib/python3.7/site-packages/flash/core/integrations/icevision/adapter.py in (.0)
86 DefaultDataKeys.INPUT: collate_fn(
---> 87 [to_icevision_record({**sample, DefaultDataKeys.METADATA: m}) for sample, m in zip(samples, metadata)]
88 ),
TypeError: 'str' object is not a mapping
To Reproduce
Launch model prediction for object-detection, master version of flash and python3.7
TypeError Traceback (most recent call last)
~/.local/share/virtualenvs/cell_instance_segm-TWYpWSyU/lib/python3.7/site-packages/flash/core/data/batch.py in forward(self, samples)
230 try:
--> 231 samples = self.collate_fn(samples, metadata)
232 except TypeError:
~/.local/share/virtualenvs/cell_instance_segm-TWYpWSyU/lib/python3.7/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
888 else:
--> 889 result = self.forward(*input, **kwargs)
890 for hook in itertools.chain(
~/.local/share/virtualenvs/cell_instance_segm-TWYpWSyU/lib/python3.7/site-packages/flash/core/data/utils.py in forward(self, *args, **kwargs)
192 def forward(self, *args, **kwargs) -> Any:
--> 193 return self.func(*args, **kwargs)
194
~/.local/share/virtualenvs/cell_instance_segm-TWYpWSyU/lib/python3.7/site-packages/flash/core/data/process.py in collate(self, samples, metadata)
439 if len(parameters) > 1 and DefaultDataKeys.METADATA in parameters:
--> 440 return collate_fn(samples, metadata)
441 return collate_fn(samples)
~/.local/share/virtualenvs/cell_instance_segm-TWYpWSyU/lib/python3.7/site-packages/flash/core/integrations/icevision/adapter.py in _collate_fn(collate_fn, samples, metadata)
86 DefaultDataKeys.INPUT: collate_fn(
---> 87 [to_icevision_record({**sample, DefaultDataKeys.METADATA: m}) for sample, m in zip(samples, metadata)]
88 ),
~/.local/share/virtualenvs/cell_instance_segm-TWYpWSyU/lib/python3.7/site-packages/flash/core/integrations/icevision/adapter.py in (.0)
86 DefaultDataKeys.INPUT: collate_fn(
---> 87 [to_icevision_record({**sample, DefaultDataKeys.METADATA: m}) for sample, m in zip(samples, metadata)]
88 ),
TypeError: 'str' object is not a mapping
Code sample
Expected behavior
Environment
conda
,pip
, source): pipAdditional context
The text was updated successfully, but these errors were encountered: