voxel51 / fiftyone

The open-source tool for building high-quality datasets and computer vision models
https://fiftyone.ai
Apache License 2.0
8.12k stars 541 forks source link

[BUG] [DOCUMENTATION]: Cannot load models - "You must run `eta install models` in order to use this model" and "module 'eta' has no attribute 'config'" #1626

Open TommeTao opened 2 years ago

TommeTao commented 2 years ago

Hi there, I run into the following issue and I have the feeling that it might be both, a bug and lacking documentation (more below).

System information

Commands to reproduce

I followed the example usage for efficientdet-d7-1536-coco-tf2 to load the model:

import fiftyone.zoo as foz
model = foz.load_zoo_model("efficientdet-d7-1536-coco-tf2", install_requirements=True)

Output:

You must run `eta install models` in order to use this model

The output puzzled me because it did not state where to run eta install models and what eta actually is. Searching for eta install in the fiftyone documentation did not reveal anything useful either. A web search brought me eventually to @ehofesmann's article stating:

We can use the eta package that comes with FiftyOne to easily install AutoML:

Thus I ran eta install models in my conda environment. After that, I still fail to load the model. The output just turns into:

AttributeError: module 'eta' has no attribute 'config'.

Describe the problem

After running eta install models in my conda environment:

Code to reproduce issue

In PowerShell terminal:

conda create --name fiftyone-tensorflow python=3.9
conda activate fiftyone-tensorflow
conda install -c anaconda tensorflow-gpu
pip install fiftyone
# for second issue
eta install models    

In a Python script:

import fiftyone.zoo as foz
model = foz.load_zoo_model("efficientdet-d7-1536-coco-tf2", install_requirements=True)

What areas of FiftyOne does this bug affect?

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?

brimoor commented 2 years ago

ETA is a package named voxel51-eta(https://github.com/voxel51/eta) and is a dependency of FiftyOne.

eta install models is a CLI command that tries to run this bash script, which is located on your machine at

${VOXEL51_ETA_PATH}/eta/tensorflow/install_models.bash

Run pip show voxel51-eta to see VOXEL51_ETA_PATH on your machine.

I'm guessing the script is failing since you're on Windows.

If you could share a version of the script that works on Windows, that'd be super helpful!!

sourabhyadav commented 2 years ago

I am facing another issue while running image_deduplication.pynb

While loading the cifar100 dataset:

dataset_name = "cifar100_4"
dataset_dir = "/data/sourabh/duplicate_img_fityone/data/cifar100_with_duplicates"

dataset = fo.Dataset.from_dir(
    dataset_dir = dataset_dir,
    dataset_type = fo.types.ImageClassificationDirectoryTree,
    name=dataset_name
)

I am facing following error:

AttributeError                            Traceback (most recent call last)
<ipython-input-12-4d5c6717069f> in <module>()
      9     dataset_dir = dataset_dir,
     10     dataset_type = fo.types.ImageClassificationDirectoryTree,
---> 11     name=dataset_name
     12 )

/home/sourabh/.local/lib/python3.6/site-packages/fiftyone/core/dataset.py in from_dir(cls, dataset_dir, dataset_type, data_path, labels_path, name, label_field, tags, **kwargs)
   3669             label_field=label_field,
   3670             tags=tags,
-> 3671             **kwargs,
   3672         )
   3673         return dataset

/home/sourabh/.local/lib/python3.6/site-packages/fiftyone/core/dataset.py in add_dir(self, dataset_dir, dataset_type, data_path, labels_path, label_field, tags, expand_schema, add_info, **kwargs)
   2457             tags=tags,
   2458             expand_schema=expand_schema,
-> 2459             add_info=add_info,
   2460         )
   2461 

/home/sourabh/.local/lib/python3.6/site-packages/fiftyone/core/dataset.py in add_importer(self, dataset_importer, label_field, tags, expand_schema, add_info)
   3001             tags=tags,
   3002             expand_schema=expand_schema,
-> 3003             add_info=add_info,
   3004         )
   3005 

/home/sourabh/.local/lib/python3.6/site-packages/fiftyone/utils/data/importers.py in import_samples(dataset, dataset_importer, label_field, tags, expand_schema, add_info)
    128         samples = map(parse_sample, iter(dataset_importer))
    129         sample_ids = dataset.add_samples(
--> 130             samples, expand_schema=expand_schema, num_samples=num_samples
    131         )
    132 

/home/sourabh/.local/lib/python3.6/site-packages/fiftyone/core/dataset.py in add_samples(self, samples, expand_schema, validate, num_samples)
   1375 
   1376         sample_ids = []
-> 1377         with fou.ProgressBar(total=num_samples) as pb:
   1378             for batch in batcher:
   1379                 sample_ids.extend(

/home/sourabh/.local/lib/python3.6/site-packages/fiftyone/core/utils.py in __init__(self, *args, **kwargs)
    797             kwargs["max_width"] = 90
    798 
--> 799         super().__init__(*args, **kwargs)
    800 
    801 

/home/sourabh/.local/lib/python3.6/site-packages/eta/core/utils.py in __init__(self, total, show_percentage, show_iteration, show_elapsed_time, show_remaining_time, show_iter_rate, iters_str, start_msg, complete_msg, use_bits, use_bytes, max_width, num_decimals, max_fps, quiet)
   1567             quiet: whether to suppress printing of the bar
   1568         """
-> 1569         if not eta.config.show_progress_bars:
   1570             quiet = True
   1571 

AttributeError: module 'eta' has no attribute 'config'

eta seems installed:

pip show voxel51-eta

Name: voxel51-eta
Version: 0.6.5
Summary: Extensible Toolkit for Analytics
Home-page: https://github.com/voxel51/eta
Author: Voxel51, Inc.
Author-email: info@voxel51.com
License: Apache
Location: /home/sourabh/.local/lib/python3.6/site-packages
Requires: argcomplete, dill, future, glob2, importlib-metadata, ndjson, numpy, opencv-python-headless, packaging, patool, Pillow, python-dateutil, pytz, requests, retrying, scikit-image, six, sortedcontainers, tabulate, tzlocal, urllib3
Required-by: fiftyone

Kindly guide me. Thanks

brimoor commented 2 years ago

@sourabhyadav why did you respond to this issue? Did you previously run eta install models?

My first recommendation is to restart your Python session/notebook and then try again.

If that doesn't solve the issue, I would recommend creating a new issue with your environment details provided per the issue template so we can better diagnose.

JoyLinWQ commented 1 year ago

ETA is a package named voxel51-eta(https://github.com/voxel51/eta) and is a dependency of FiftyOne.

eta install models is a CLI command that tries to run this bash script, which is located on your machine at

${VOXEL51_ETA_PATH}/eta/tensorflow/install_models.bash

Run pip show voxel51-eta to see VOXEL51_ETA_PATH on your machine.

I'm guessing the script is failing since you're on Windows.

If you could share a version of the script that works on Windows, that'd be super helpful!!

Hi @brimoor , I have tried pip show voxel51-eta and it displays the path correctly. However, eta install models give similar path below without "/".

/bin/bash: C:UsersXXXXanaconda3envsfiftyone_tf1libsite-packagesetatensorflowinstall_models.bash: No such file or directory

How can this be resolved? I've attached the install_models.bash as a .txt file. install_models.txt

Thanks in advance! -Joy