Esri / raster-deep-learning

ArcGIS built-in python raster functions for deep learning to get you started fast.
Apache License 2.0
186 stars 87 forks source link

TensorFlow example - ERROR 002667 Unable to initialize python raster function with scalar arguments. #17

Closed mariaculman18 closed 5 years ago

mariaculman18 commented 5 years ago

I have bee trying to run this example (https://learn.arcgis.com/en/projects/use-deep-learning-to-assess-palm-tree-health/lessons/detect-palm-trees-with-a-deep-learning-model.htm) on coconut tree detection and counting but I get this error when I upload the model:

ERROR 002667 Unable to initialize python raster function with scalar arguments. [c:\users\culmanfm\appdata\local\programs\arcgis\pro\Resources\Raster\Functions\System\DeepLearning\ObjectDetector.py] Traceback (most recent call last): File "C:\Users\CULMANFM\AppData\Local\ESRI\conda\envs\arcgispro-py3-coconuts\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\CULMANFM\AppData\Local\ESRI\conda\envs\arcgispro-py3-coconuts\Lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\CULMANFM\AppData\Local\ESRI\conda\envs\arcgispro-py3-coconuts\Lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\CULMANFM\AppData\Local\ESRI\conda\envs\arcgispro-py3-coconuts\Lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\CULMANFM\AppData\Local\ESRI\conda\envs\arcgispro-py3-coconuts\Lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found.

hanhu7 commented 5 years ago

@mariaculman18 Hi, this error usually indicates that your CUDA is not setup correctly. Please make sure you have the right version of CUDA installed and configured for tensorflow. Here is the tensorflow software requirements. https://www.tensorflow.org/install/gpu

mariaculman18 commented 5 years ago

Hi @hanhu7, I am trying to run the example with Tensorflow CPU since I don't have an Nvidia GPU. It's that possible?

hanhu7 commented 5 years ago

@mariaculman18 sure, that is also good. If you only want to use CPU version tensorflow to do the model inference, you could just do pip install tensorflow and make sure you can successfully run import tensorflow in your active pro python environment.

mariaculman18 commented 5 years ago

Hi @hanhu7,

I just created a new environment and installed Tensorflow 1.12.0 (pip install tensorflow==1.12.0). Also, I updated the Python Raster functions in the folder (C:\Users\CULMANFM\AppData\Local\Programs\ArcGIS\Pro\Resources\Raster\Functions\System\DeepLearning) with the ones you have available here in the Github. After that, this is the error that I was getting:

ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. Unable to obtain configuration properties associated with the raster function. Traceback (most recent call last): File "c:\users\culmanfm\appdata\local\programs\arcgis\pro\Resources\Raster\Functions\System\DeepLearning\ObjectDetector.py", line 142, in getConfiguration configuration = self.child_object_detector.getConfiguration(scalars) File "c:\users\culmanfm\appdata\local\programs\arcgis\pro\Resources\Raster\Functions\System\DeepLearning\Templates\TemplateBaseDetector.py", line 55, in getConfiguration self.score_threshold = float(scalars['score_threshold']) ValueError: could not convert string to float: '0,6' Configuration properties returned by the python raster function is not a python dictionary. Unable to obtain configuration properties associated with the raster function. Traceback (most recent call last): File "c:\users\culmanfm\appdata\local\programs\arcgis\pro\Resources\Raster\Functions\System\DeepLearning\ObjectDetector.py", line 142, in getConfiguration configuration = self.child_object_detector.getConfiguration(scalars) File "c:\users\culmanfm\appdata\local\programs\arcgis\pro\Resources\Raster\Functions\System\DeepLearning\Templates\TemplateBaseDetector.py", line 55, in getConfiguration self.score_threshold = float(scalars['score_threshold']) ValueError: could not convert string to float: '0,6' Configuration properties returned by the python raster function is not a python dictionary. Failed to execute (DetectObjectsUsingDeepLearning).

So I changed the '0,6' for '0.6' in the score threshold field, and now it is running. And it is working! 👍

Screenshot (54)

hanhu7 commented 5 years ago

@mariaculman18 Great! The comma number is a localization issue which the tool doesn't hand over to python raster function properly and we have fixed that in a recent arcgis release.