Project-AgML / AgML

AgML is a centralized framework for agricultural machine learning. AgML provides access to public agricultural datasets for common agricultural deep learning tasks, with standard benchmarks and pretrained models, as well the ability to generate synthetic data and annotations.
Apache License 2.0
176 stars 28 forks source link

No "~/.agml/helios_config.json" file error #28

Closed ctyeong closed 2 years ago

ctyeong commented 2 years ago

Hi.

The code below pprint(agml.synthetic.available_canopies())

generates the following error

FileNotFoundError: [Errno 2] No such file or directory: /home/username/.agml/helios_config.json

Should I have installed Helios separately?

amogh7joshi commented 2 years ago

This will be fixed in the next update. For now, please run agml.synthetic.reinstall_helios() in order to install Helios.

ctyeong commented 2 years ago

Another error comes up:

Existing installation of Helios not found. Installing Helios to: /home/username/anaconda3/envs/agml/lib/python3.7/site-packages/agml/_helios/Helios bash: /home/username/anaconda3/envs/agml/lib/python3.7/site-packages/agml/_helios/helios_install.sh: No such file or directory Updating Helios parameter configuration.

amogh7joshi commented 2 years ago

AgML v0.4.2 has just been published, which should address any issues you're having with installing Helios. Please run pip install --upgrade agml, and let us know if you run into any further errors.

ctyeong commented 2 years ago

Thanks for your quick response. pprint(agml.synthetic.available_canopies()) now successfully installs Helios, but the error below pops up:

Existing installation of Helios not found.
Installing Helios to:
    /home/username/anaconda3/envs/agml/lib/python3.7/site-packages/agml/_helios/Helios
Cloning into '/home/username/anaconda3/envs/agml/lib/python3.7/site-packages/agml/_helios/Helios'...
Checking out files: 100% (5950/5950), done.
Updating Helios parameter configuration.

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
/tmp/ipykernel_13376/498637370.py in <module>
----> 1 pprint(agml.synthetic.available_canopies())

~/anaconda3/envs/agml/lib/python3.7/site-packages/agml/synthetic/config.py in verify(*args, **kwargs)
     68     """This decorator wraps any methods which require Helios to be installed."""
     69     def verify(*args, **kwargs):
---> 70         _check_helios_installation()
     71         return f(*args, **kwargs)
     72     return verify

~/anaconda3/envs/agml/lib/python3.7/site-packages/agml/synthetic/config.py in _check_helios_installation()
    143     project_dir = os.path.join(os.path.dirname(__file__), 'synthetic_data_generation')
    144     output_dir = os.path.join(helios_dir, 'projects', 'SyntheticImageAnnotation')
--> 145     shutil.copytree(project_dir, output_dir)
    146     os.makedirs(os.path.join(output_dir, 'xml'), exist_ok = True)
    147 

~/anaconda3/envs/agml/lib/python3.7/shutil.py in copytree(src, dst, symlinks, ignore, copy_function, ignore_dangling_symlinks)
    307 
    308     """
--> 309     names = os.listdir(src)
    310     if ignore is not None:
    311         ignored_names = ignore(src, names)

FileNotFoundError: [Errno 2] No such file or directory: '/home/username/anaconda3/envs/agml/lib/python3.7/site-packages/agml/synthetic/synthetic_data_generation'
amogh7joshi commented 2 years ago

Ok, this error should now be fixed in the latest version (v0.4.3). Python's packaging is slightly frustrating because it only includes .py files, and as the AgML <=> Helios interface is a mix of C++ and Bash scripts, they weren't correctly included in the package. Let me know if you run into any other errors.

ctyeong commented 2 years ago

I can see it fixed. Thank you!