Select to view content in your preferred language

Deep Learning Object Detection:ERROR 002667 Unable to initialize python raster function with scalar arguments.

12732
20
06-15-2019 11:14 AM
AHMEDSHEHATA1
Occasional Contributor

Hi Everyone, 
I followed the lesson  Use deep learning to assess Palm tree health, everything went well except when I was about to run the Detect Objects Using Deep Learning tool. "The below error came up after browsing to the esri model definition file. I have read another thread on the same topic Here, but ended up with the fact that I need to install Tensorflow on GPU, and unfortunately I do not have Nvidia GPU card. Did anyone manage to run this tool with tensorflow on CPU not GPU? or Has any workaround?Error snap shot 

ERROR 002667  Unable to initialize python raster function with scalar arguments.

Windows 10

ArcGIS Pro 2.3.3

Tensorflow and Tensorflow - base packages added 

20 Replies
KathyCappelli
Esri Contributor

Hi Ahmed,

What version of tensorflow did you install? If you're trying to run 1.13, there may be issues with the versioning on dependent packages. Uninstall your current version of tensorflow, then in the Python Command Prompt, try running pip install tensorflow==1.12.0.

0 Kudos
AHMEDSHEHATA1
Occasional Contributor

Hi Kathy,

I uninstalled tensorflow 1.13, then installed 1.12.0 using pip in python command prompt, but didn't work for me. 

I gave a try and installed tensorflow once more using conda (to include CUDA and cuDNN), but didn't work either.

Thank you anyway

0 Kudos
MariaCulman
Emerging Contributor

Hi Kathy Cappelli‌,

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 available in the Github (https://github.com/Esri/raster-deep-learning/tree/master/python_raster_functions). 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! .

AHMEDSHEHATA1
Occasional Contributor

Hi Maria Culman

I'm glad you managed to run the tool. I've tried to do the same on my machine, but it didn't work. 

I installed Tensorflow 1.12.0.Then, when I tried to update the python raster functions, I found them in a different path:

C:\Program Files\ArcGIS\Pro\Resources\Raster\Functions\System\DeepLearning

I copied the ones from the github repo., but the tool came uo with the same old error. 

I even ran the env_setup batch file in the repo, but didn't work.  

0 Kudos
AHMEDSHEHATA1
Occasional Contributor

Hello Everyone, 

I just wanted to let you know, that I managed to get a PC with GPU card (CUDA-enabled) and the tool ran smoothly, with tensorflow 1.13 and without even the need to update the python raster functon. 

I also managed to run it on CPU, by re-installing ArcGIS Pro for my user (not all users on the machine) and using (pip install tensorflow==1.12.0) to install Tensorflow 1.12.0

After all, I believe the tool is not yet compatible with tensorflow 1.13 running on CPU

Thank you all for your help.

BraulioGalvez1
Esri Contributor

Hi Ahmed !

For me this is a bug! I don't know if someone had this issue on ArcGIS Pro 2.4, but I followed all your suggestions of this thread without success. I need perform a DEMO showing deep learing and I cannot for this error. In this moment, that is being reviewed for Esri Support but they apparently do not have an answer either. My case also is in: https://community.esri.com/thread/232018-deep-learning-object-detection-error-unable-to-initialize-p...

I do not know if someone will have any solution that in this thread, has not been proposed. In advance, thank you very much!

Braulio.

0 Kudos
AHMEDSHEHATA1
Occasional Contributor

Hi Braulio, 

Unfortunately, I have not tried the workaround that "worked for me" on ArcGIS Pro 2.4.

I totally agree with you that this is a bug!

As you need to perform your demo, I believe you either try to perform it on a machine with Nvidia GPU card, or downgrade to ArcGIS Pro 2.3 till this bug is fixed. Thank you and please feed us back if one of my two suggetions worked for you.

BraulioGalvez1
Esri Contributor

I could already find what is the biggest drawback of this. It is not a problem as such, but there is a file called "frozen_inference_graph.pb" which if it is not in the correct path, the model will not be read correctly with the tool. I do not know how this file is generated and because it is important in the model, however in the DEMO data located in the compass site, the * .pb file does not appear and from the WEB: https://learn.arcgis.com/ en / projects / use-deep-learning-to-assess-palm-tree-health / lessons / create-training-samples.htm # ESRI_SECTION1_37EB6255CA0D4ED8B6B9CC98973ED7B7, if you can download and route to a specific directory, as long as the EMD file is configured to read the route where the model is located.


I would like to know more about this topic and the "How" the * .pb file is generated and what is the utility in the model, with the purpose of being able to generate an own file of * .pb.

On the Github website: https://github.com/Esri/raster-deep-learning/tree/master/  it is only described that the * .pb is a training model file, however when data is transformed into data trained, ArcGIS Pro does NOT generate the * .pb file.

PD: Tensorflow run with version 1.12.0 on ArcGIS Pro 2.4, the error continue when I used Tensorflow 1.13.1

Thank you!

Braulio.

RVG296
by
Regular Contributor

Hello Ahmed,

Thanks for your insights on this topic. I have received a similar issue in ArcGIS Pro 2.5, but this time it's with tensorflow-gpu 2.0 and pytorch 1.3. The error is same as you mentioned above. So after reading this thread, I rolled back both my tensorflow and pytorch version, but it still didn't work. I also made sure I installed the right versions which were mentioned here. 

Install deep learning frameworks for ArcGIS—ArcGIS Pro | Documentation 

Also my machine is GPU enabled. So could you please suggest me, if there is any other approach to solve this issue.

Thank you.

NoemiRoecklinger
New Contributor

Hi Rohit Venkat Gandhi Mendadhala‌ 

I am having the same issue. ArcGIS Pro 2.5, after TF not working through CONDA install, I did a PIP install for tensorflow-cpu (I don't have a GPU enabled machine). 
Did you find a workaround by any chance?

0 Kudos