Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] UnboundLocalError: local variable 'd' referenced before assignment #1149

Closed
2 of 6 tasks
taomanwai opened this issue Jul 31, 2021 · 2 comments · Fixed by #1150
Closed
2 of 6 tasks

[BUG] UnboundLocalError: local variable 'd' referenced before assignment #1149

taomanwai opened this issue Jul 31, 2021 · 2 comments · Fixed by #1150
Labels
bug Bug fixes

Comments

@taomanwai
Copy link

Instructions

System information

  • Linux Ubuntu
  • FiftyOne installed from pip
  • FiftyOne v0.11.2
  • Python v3.8.5

Commands to reproduce

python app.py

Describe the problem

I wrote app.py to load coco-2017 dataset and launch web app of fiftyone, but crash with Exception

Code to reproduce issue

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset(
    "coco-2017",
    split="validation",
    dataset_name="evaluate-detections-tutorial",
)
dataset.persistent = True

session = fo.launch_app(dataset)

session.wait()

Other info / logs

Log is:
Downloading split 'validation' to '/home/tommytao/fiftyone/coco-2017/validation' if necessary
Found annotations at '/home/tommytao/fiftyone/coco-2017/raw/instances_val2017.json'
Images already downloaded
Uncaught exception
Traceback (most recent call last):
File "51app.py", line 4, in
dataset = foz.load_zoo_dataset(
File "/home/tommytao/miniconda3/envs/ai/lib/python3.8/site-packages/fiftyone/zoo/datasets/init.py", line 195, in load_zoo_dataset
info, dataset_dir = download_zoo_dataset(
File "/home/tommytao/miniconda3/envs/ai/lib/python3.8/site-packages/fiftyone/zoo/datasets/init.py", line 116, in download_zoo_dataset
return zoo_dataset.download_and_prepare(
File "/home/tommytao/miniconda3/envs/ai/lib/python3.8/site-packages/fiftyone/zoo/datasets/init.py", line 1022, in download_and_prepare
) = self._download_and_prepare(split_dir, scratch_dir, split)
File "/home/tommytao/miniconda3/envs/ai/lib/python3.8/site-packages/fiftyone/zoo/datasets/base.py", line 770, in _download_and_prepare
num_samples, classes, downloaded = fouc.download_coco_dataset_split(
File "/home/tommytao/miniconda3/envs/ai/lib/python3.8/site-packages/fiftyone/utils/coco.py", line 1617, in download_coco_dataset_split
if d is None:
UnboundLocalError: local variable 'd' referenced before assignment

What areas of FiftyOne does this bug affect?

  • App: FiftyOne application issue
  • Core: Core fiftyone Python library issue
  • Server: Fiftyone server issue

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.
@taomanwai taomanwai added the bug Bug fixes label Jul 31, 2021
@brimoor brimoor mentioned this issue Jul 31, 2021
benjaminpkane added a commit that referenced this issue Jul 31, 2021
@brimoor
Copy link
Contributor

brimoor commented Jul 31, 2021

Hi @taomanwai 👋 thanks for reporting. This is fixed in fiftyone==0.11.2.1 and you can upgrade like so:

pip install --upgrade fiftyone

@taomanwai
Copy link
Author

Thanks, work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants