Esri / deep-learning-frameworks

Installation support for Deep Learning Frameworks for the ArcGIS System
433 stars 105 forks source link

NameError: name '_get_emd_path' is not defined #65

Closed Abbsalehi closed 10 months ago

Abbsalehi commented 1 year ago

Could you please assist me to fix this issue?

No module named 'fastai.basic_train' Traceback (most recent call last): File "C:/Users/asalehit/AppData/Local/JetBrains/Toolbox/apps/PyCharm-P/ch-0/223.8617.48/plugins/python/helpers/pydev/pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\Users\asalehit\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\223.8617.48\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:\Users\asalehit\OneDrive - University of New Brunswick\UNB\PhD Thesis\Scripts\Python\window_door_03.py", line 11, in fcnn = FasterRCNN.from_model(model_def_path, data=None) File "C:\Users\asalehit\AppData\Local\miniconda3\envs\PhD\lib\site-packages\arcgis\learn\models_faster_rcnn.py", line 680, in from_model emd_path = _get_emd_path(emd_path) NameError: name '_get_emd_path' is not defined

Process finished with exit code 1

scdub commented 1 year ago

Can you reproduce this error outside of PyCharm? If running from a standalone Python session, does from arcgis.learn._utils.common import _get_emd_path work? The fastai error perhaps means that there is some issue in the environment, if you're using the installer you could check if the workflow works when using the default arcgispro-py3 environment.

Abbsalehi commented 1 year ago

Thank you for your comment, the previous one was gone and now I'm still challenging this error.

NameError: name 'get_multispectral_data_params_from_emd' is not defined

Library:

from arcgis.learn import prepare_data, FasterRCNN

Python 3.8.16 Conda environment IDE=Pycharm

If you need more info, please let me know

scw commented 10 months ago

@Abbsalehi It looks like you're using this outside of the Pro context in a custom environment, if you're still running into issues please log it at https://github.com/Esri/arcgis-python-api/issues as the package set and Python version vary between the two environments.

Abbsalehi commented 2 months ago

Update:

The error occurs when installing the package using:

conda install -c esri arcgis

To resolve this, install the package using:

conda install -c esri arcgis_learn

If you encounter the following warning:

FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar. 0, 1, 1, 0, 0, 1, 0, 0, 0], dtype=np.bool)

you should downgrade NumPy to version 1.23.1 if you have version 24.XX (optional)

pip install numpy==1.23.1

Note: The solution has been tested with Python 3.8. Compatibility with other Python versions has not been verified.

Recommendation: It is advisable to install the package in a fresh environment to avoid any conflicts with existing packages.

OS: Linux 20 LTS

Hope, this helps. @scw @scdub

scw commented 2 months ago

@Abbsalehi OK, yes in a fresh environment you should be able to install arcgis and arcgis_learn to get the current package set for Linux. Linux installs deployed in this way should ideally use just conda packages, and the NumPy versions specified in the API should be sufficient to get you a consistent environment. It is possible 3.8 is on older packages, that's now beyond the support window of Python versions we build and maintain against (currently Python 3.9—3.11).