Can't read images with deep learning imbedded model

Solved!
aurelienallard
Level 1
Can't read images with deep learning imbedded model

Hello all, 

I can't solve this problem. I imported a set of images sorted in two subfolders:
- images :
/class_0/yyyyy.jpg
/class_1/xxxxx.jpg

I created a dataset with two columns :
- column A: path (string)
- column B : label (int)

Then I created a deep learning model included in the visual analysis. 

But when I train the model, I have the following error. 

Failed to train : <class 'Exception'> : Failed to preprocess the following file: '/class_0/AE00354_042142_00_1_2_2001.jpg', Error: expected str, bytes or os.PathLike object, not HTTPResponse

Do you have any clue where the problem come from ? 

Thanks in advance, 

0 Kudos
1 Solution
Nicolas_Servel
Dataiker

Hello Aurรฉlien, 

Can you please check the version of "keras-preprocessing" that you are using. This is a package installed when installing keras, that provides utilities for preprocessing, including the "load_img" that you are using for the preprocessing of your model.

Starting version 1.1.2 of this package, it prevents to pass an object-like to the "load_img" function, leading to the error you are experiencing.

That is why, in the proposed packages by DSS, we enforce using version 1.1.0 of keras-preprocessing

To verify the version you are using, please

* go to your model

* go to Design > Runtime environment > note the name of the code environment used

* then, go to Administration > Code-envs > the environment (note that you need a certain level of permissions to go there, if you do not have them, you would need to ask the administrator of your DSS instance to do that for you)

* go to "Installed packages" and look for "keras-preprocessing"

 

If that version is indeed >= 1.1.2, you can enforce it to 1.1.0 by:
* going to "Packages to install"

* adding "keras-preprocessing==1.1.0" to the list

* click on "Save and update"

 

Then the training should work properly.

 

As an advice, we encourage you to use the "Sets of packages" proposed by DSS as base packages when you are using the visual Machine Learning. Those are available when clicking on "Add sets of packages" in the "Packages to install" tab. This way, you will use versions of packages that were thoroughly tested by Dataiku.

 

Hope this helps,

Best regards

 

 

 

 

View solution in original post

2 Replies
Nicolas_Servel
Dataiker

Hello Aurรฉlien, 

Can you please check the version of "keras-preprocessing" that you are using. This is a package installed when installing keras, that provides utilities for preprocessing, including the "load_img" that you are using for the preprocessing of your model.

Starting version 1.1.2 of this package, it prevents to pass an object-like to the "load_img" function, leading to the error you are experiencing.

That is why, in the proposed packages by DSS, we enforce using version 1.1.0 of keras-preprocessing

To verify the version you are using, please

* go to your model

* go to Design > Runtime environment > note the name of the code environment used

* then, go to Administration > Code-envs > the environment (note that you need a certain level of permissions to go there, if you do not have them, you would need to ask the administrator of your DSS instance to do that for you)

* go to "Installed packages" and look for "keras-preprocessing"

 

If that version is indeed >= 1.1.2, you can enforce it to 1.1.0 by:
* going to "Packages to install"

* adding "keras-preprocessing==1.1.0" to the list

* click on "Save and update"

 

Then the training should work properly.

 

As an advice, we encourage you to use the "Sets of packages" proposed by DSS as base packages when you are using the visual Machine Learning. Those are available when clicking on "Add sets of packages" in the "Packages to install" tab. This way, you will use versions of packages that were thoroughly tested by Dataiku.

 

Hope this helps,

Best regards

 

 

 

 

aurelienallard
Level 1
Author

Thank you for your advice. It is working properly now! ๐Ÿ™‚

0 Kudos