Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
RobertoNavarro
Frequent Visitor

Problems with the AutoML process

Hi team,

 

I'm having an issue with the AutoML functionlity in Fabric (trial).

 

Several months ago (around 4 or 5), I followed the example provided on Microsoft Learn (https://learn.microsoft.com/en-us/fabric/data-science/how-to-use-automated-machine-learning-fabric), and it worked perfectly. However, when I tried to execute it again a couple of months ago, I encountered issues with the FLAML library. Considering that this feature is still in preview, I decided to wait. Unfortunately, when I tested it again yesterday, I encountered the same problem.

 

This is the code

# Import the AutoML class from the FLAML package
from flaml import AutoML
# Create an AutoML instance
automl = AutoML()
 
And this is the error
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[52], line 2
1 # Import the AutoML class from the FLAML package
----> 2 from flaml import AutoML
3 # Create an AutoML instance
4 automl = AutoML()
ImportError: cannot import name 'AutoML' from 'flaml' (unknown location)
 
I have tried different options, but none worked for me, do you have any idea...
1 ACCEPTED SOLUTION

Hi @RobertoNavarro,

It seems like I forget the recently update on the spark runtime environments, they may affect all the packages usage that requires the specific environment versions.

For this scenario, you can wait for the new version release or try to contact to the AutoML package dev team to update the compatibility version.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

6 REPLIES 6
RobertoNavarro
Frequent Visitor

Hi,

 

First of all, thank you for your response.

 

Regarding your question, yes, I have tried using pip with various options—upgrading, installing, and uninstalling/reinstalling the library. I’ve also created a new environment and manually included the library, but the same result.

 

I exported and executed the notebook in a Conda environment on my laptop, and it worked perfectly. Interestingly, when I run the following commands:

 

import flaml
import inspect
 
print(inspect.getmembers(flaml, inspect.isclass)) # Lists all classes
print(inspect.getmembers(flaml, inspect.isfunction)) # Lists all functions

 

In Fabric:

[] []

 

In Conda:

[('AutoML', <class 'flaml.automl.automl.AutoML'>), ('AutoVW', <class 'flaml.onlineml.autovw.AutoVW'>), ('BlendSearch', <class 'flaml.tune.searcher.blendsearch.BlendSearch'>), ('BlendSearchTuner', <class 'flaml.tune.searcher.blendsearch.BlendSearchTuner'>), ('CFO', <class 'flaml.tune.searcher.blendsearch.CFO'>), ('FLOW2', <class 'flaml.tune.searcher.flow2.FLOW2'>), ('RandomSearch', <class 'flaml.tune.searcher.blendsearch.RandomSearch'>)]
[]

 

I'm not sure if this is helpful...

 

Another point that I mentioned in my previous message, I ran this notebook in Fabric about 4 or 5 months ago, and it worked perfectly back then.

 

Regards

Hi @RobertoNavarro,

According to the result, it seems like these package havn't initialized correctly in fabric environment and Conda environment works well.

If this works at previous, I suppose they may relate to the package update and it seems not compatible with the version that fabric supported. (normally the notebook environment library not update immediately followed the packages and it will keep use the most popular stable versions)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

 

I think that I have found a possible answer, if I execute help(modules) among all the output, I have got this:

 

****** AutoML Prerequisites ******

AutoML requires an Apache Spark pool (version 2.4) in your Azure Synapse Analytics workspace.

You are using a Spark 3.x pool, please use Spark 2.x pool. For details, see: https://docs.microsoft.com/en-us/azure/synapse-analytics/machine-learning/tutorial-automl#prerequisi...

 

And in this webpage:

 

 Warning

  • Effective September 29, 2023, Azure Synapse will discontinue official support for Spark 2.4 Runtimes. Post September 29, 2023, we will not be addressing any support tickets related to Spark 2.4. There will be no release pipeline in place for bug or security fixes for Spark 2.4. Utilizing Spark 2.4 post the support cutoff date is undertaken at one's own risk. We strongly discourage its continued use due to potential security and functionality concerns.
  • As part of the deprecation process for Apache Spark 2.4, we would like to notify you that AutoML in Azure Synapse Analytics will also be deprecated. This includes both the low code interface and the APIs used to create AutoML trials through code.
  • Please note that AutoML functionality was exclusively available through the Spark 2.4 runtime.
  • For customers who wish to continue leveraging AutoML capabilities, we recommend saving your data into your Azure Data Lake Storage Gen2 (ADLSg2) account. From there, you can seamlessly access the AutoML experience through Azure Machine Learning (AzureML). Further information regarding this workaround is available here.

So I think that this feature of AutoML cannot be use either in fabric regarding that the underlying engine is Synapse Spark Pools, is this correct?

Hi @v-shex-msft,

 

Any comment about this? I have received a couple of e-mails about if this issue is closed, but I don't have a solution, is it necessary more time to analize the problem from your side?

 

Regards and thanks for your support

Roberto

Hi @RobertoNavarro,

It seems like I forget the recently update on the spark runtime environments, they may affect all the packages usage that requires the specific environment versions.

For this scenario, you can wait for the new version release or try to contact to the AutoML package dev team to update the compatibility version.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

HI @RobertoNavarro,

It seems like the import package operation failed before processing, have you tried to use %pip command to inline install the library to the notebook?

Manage Apache Spark libraries - Microsoft Fabric | Microsoft Learn

In addition, you can also try attach this library to the environment or upload the library package.

Library management in Fabric environments - Microsoft Fabric | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Sept Fabric Carousel

Fabric Monthly Update - September 2024

Check out the September 2024 Fabric update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors