You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurs when using the Compute Visualization plugin from FiftyOne brain in the app. This issue arises specifically when the view in the app is set to "patch view." The objective is to view images at the patch level, create embeddings for the patches, and make a subset of these patches for reclustering to perform more in-depth data curation. However, Compute Visualization fails when computing the visualization while on "patch view".
Code to reproduce issue
The issue arises when using the compute_visualization plugin in the app.
Steps to reproduce
Create FiftyOne detection dataset from an image dataset and a COCO JSON file with annotations.
Launch the app from a python script.
Navigate to the "patch view"
Run the compute_visualization plugin on patch level.
The following error will occur after a few seconds.
▼Error occurred during operator execution
Traceback (most recent call last):
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/operators/executor.py", line 277, in execute_or_delegate_operator
result = await do_execute_operator(operator, ctx, exhaust=exhaust)
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/operators/executor.py", line 319, in do_execute_operator
result = await (
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/core/utils.py", line 2343, in run_sync_task
return await loop.run_in_executor(_get_sync_task_executor(), func, *args)
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/vintecc/fiftyone/__plugins__/@voxel51/brain/__init__.py", line 77, in execute
fob.compute_visualization(
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/brain/__init__.py", line 405, in compute_visualization
return fbv.compute_visualization(
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/brain/visualization.py", line 108, in compute_visualization
embeddings, sample_ids, label_ids = fbu.get_embeddings(
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/brain/internal/core/utils.py", line 759, in get_embeddings
embeddings = samples.compute_patch_embeddings(
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/core/collections.py", line 3188, in compute_patch_embeddings
return fomo.compute_patch_embeddings(
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/core/models.py", line 1470, in compute_patch_embeddings
return _embed_patches_data_loader(
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/core/models.py", line 1657, in _embed_patches_data_loader
ctx.save(sample)
File "/home/vintecc/.local/lib/python3.10/site-packages/fiftyone/core/collections.py", line 152, in save
sample_ops, frame_ops = sample._save(deferred=False)
TypeError: cannot unpack non-iterable NoneType object
Extra information
I wanted to note that when computing visualization via the plugin, the following arguments are passed to the compute_visualization function:
When calling the function when the app is in "image-view", the target_view variable is of the class 'fiftyone.core.view.DatasetView'.
However, when calling the function from "patch-view", target_view is of the class 'fiftyone.core.patches.PatchesView'.
The code fails when running sample_ops, frame_ops = sample._save(deferred=False).
I believe this is because sample is None, which makes sense as the code tries to iterate over the samples of the dataset, but the dataset consists of patches.
System information
OS Platform and Distribution: Linux Ubuntu 22.04
Python version : Python 3.10.6
FiftyOne version: 0.24.1
Willingness to contribute
The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?
Yes. I can contribute a fix for this bug independently
Yes. I would be willing to contribute a fix for this bug with guidance
from the FiftyOne community
No. I cannot contribute a bug fix at this time
The text was updated successfully, but these errors were encountered:
ZoeHermansVintecc
changed the title
Performing Compute visualization while on patch view throws error
[BUG] Performing Compute visualization while on patch view throws error
Aug 6, 2024
Describe the problem
An error occurs when using the Compute Visualization plugin from FiftyOne brain in the app. This issue arises specifically when the view in the app is set to "patch view." The objective is to view images at the patch level, create embeddings for the patches, and make a subset of these patches for reclustering to perform more in-depth data curation. However, Compute Visualization fails when computing the visualization while on "patch view".
Code to reproduce issue
The issue arises when using the compute_visualization plugin in the app.
Steps to reproduce
The following error will occur after a few seconds.
Extra information
I wanted to note that when computing visualization via the plugin, the following arguments are passed to the compute_visualization function:
When calling the function when the app is in "image-view", the target_view variable is of the class 'fiftyone.core.view.DatasetView'.
However, when calling the function from "patch-view", target_view is of the class 'fiftyone.core.patches.PatchesView'.
The code fails when running
sample_ops, frame_ops = sample._save(deferred=False)
.I believe this is because sample is None, which makes sense as the code tries to iterate over the samples of the dataset, but the dataset consists of patches.
System information
Willingness to contribute
The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?
from the FiftyOne community
The text was updated successfully, but these errors were encountered: