Error using python multiprocessing in Azure Machine Learning

I want to do some parallel data manipulation in Azure ML but I can't seem to get multiprocessing to work. 
So when I try this simple example in Azure ML Python Script Module
import multiprocessing
def azureml_main(dataframe1 = None, dataframe2 = None):
process_pool = multiprocessing.Pool(10)
l = []
for i in range(10):
l.append((0, 1000))
r = process_pool.map(do, l)
process_pool.close()
foo = 0
for a in r:
foo = foo + a
print(foo)
return dataframe1
def do(arg):
foo = 0
for i in range(arg[0], arg[1]):
foo = foo + 1
return foo
I get this error:
    Error 0085: The following error occurred during script evaluation, please view the output log for more information:
     ---------- Start of error message from Python interpreter ----------
     data:text/plain,Caught exception while executing function: Traceback (most recent call last):
    File "C:\server\invokepy.py", line 167, in batch
     odfs = mod.azureml_main(*idfs)
    File "C:\temp\azuremod.py", line 19, in azureml_main
     process_pool = multiprocessing.Pool(10)
    File "C:\pyhome\lib\multiprocessing\__init__.py", line 232, in Pool
     return Pool(processes, initializer, initargs, maxtasksperchild)
    File "C:\pyhome\lib\multiprocessing\pool.py", line 159, in __init__
     self._repopulate_pool()
    File "C:\pyhome\lib\multiprocessing\pool.py", line 223, in _repopulate_pool
     w.start()
    File "C:\pyhome\lib\multiprocessing\process.py", line 130, in start
     self._popen = Popen(self)
    File "C:\pyhome\lib\multiprocessing\forking.py", line 280, in __init__
     to_child.close()
    IOError: [Errno 22] Invalid argument
     ---------- End of error message from Python  interpreter  ----------
When I try the same code in a local regular python file it works just fine
Any ideas? Or is there another way?
 

Hello Grahamaaa,
(a) Regarding map: Yes, vanilla map, list comprehensions, generators, etc. are all sequential.
(b) NumPy: You can call into multi-threaded native code (via OpenMP/TBB/etc.) as long as they follow the usual GIL locking/unlocking protocol. There are some calls such as SetCpuAffinity that are not supported.
There are essentially two ways to around the GIL in CPython: write C extensions that use threads or spawn multiple Python interpreters. The first approach should work modulo calls like SetCpuAffinity.
We are looking into why the fork call in Python is not working.
Regards,
Sudarshan (AzureML)

Similar Messages

  • **Free** 58-page e-book on using Azure Machine Learning and R

    Free for download: "Data Science in the Cloud with Microsoft Azure Machine Learning and R" By Stephen Elston, Managing Director of Quantia Analytics, LLC.
    To get you started creating and evaluating your own machine learning models, O’Reilly has commissioned a new report: “Data Science in the Cloud, with Azure Machine Learning and R.” We use an in-depth data science example — predicting bicycle rental demand —
    to show you how to perform basic data science tasks, including data management, data transformation, machine learning, and model evaluation in the Microsoft Azure Machine Learning cloud environment. Using a free-tier Azure ML account, example R scripts, and
    the data provided, the report provides hands-on experience with this practical data science example.
    Specifically, this report shows you how to complete the following tasks using Azure ML and R:
    ◾Manage and transform data, using a highly scalable cloud environment
    ◾Build and evaluate machine learning models
    ◾Produce R graphics
    ◾Publish your models as web services
    To download your free e-book, visit: https://azureinfo.microsoft.com/CO-Azure-CNTNT-FY15-02Feb-Data-Science-in-the-Cloud.html?ls=Media&lsd=Oreilly

    Hi AK.
    I'm running Windows 10 ETP with builtin IE, but the same problem is also with the latest Chrome 41. Using local DNS resolver with DNSSEC validation.
    I'll try it later today at home and let you know.

  • Login problem with federated id to Azure Machine Learning

    I log into Azure with a federated account ( organization account ).  This works great for all the services I have used so far, but when I try to use the Azure Machine Learning  product, it seems to require a Microsoft Live account.  
    Is there a way to log into Azure Machine Learning with a federated account?
    I am using my personal account to post this since I could not log in with my federated account to fill in the form for the question.
    Thanks

    Sorry, at the moment we only support Live IDs. We are working on adding more support for authentication
    Regards,
    AK

  • Recommendations API by Azure Machine Learning - not working

    I purchased the Recommendations API by Azure Machine Learning using the marketplace. When I go to the API explorer and the quickstart
    screen, all i see is the rotating circles. I waited for about 10 minutes...no luck. I tried the sample app and it seem to build, run and work. Not sure what's going with the azure portal UI. Is
    anyone really using it in prod? 

    This is a known issue in the Azure Management Portal, and it is being worked one. That said, it is only a visual glitch in the quick start page. You should be able to click on the DASHBOARD tab, and be able to access all the links required to use the Recommendations
    API.
    The marketplace in the management portal is in "PREVIEW" mode right now, and this is one of the issues that needs to be fixed there.
    thanks!
    -Luis Cabrera
    Azure Machine Learning Marketplace.
    Luis Cabrera. Program Manager -- Azure Machine Learning @luisito_cabrera Disclaimer: This post is provided "AS IS" with no warranties, and confer no rights.

  • General Availabilty Release of Azure Machine Learning!

    Microsoft has announced the General Availability release of Azure Machine Learning. For details, please see this forum announcement:
    https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=MachineLearning&announcementId=25a9893a-d3d8-4e4d-8a17-0f9bc60ec6a9

    Hello Yordan,
    Thanks for the quick answer.
    Do you know if that's something in the plan? Any idea of a timeline you can share?

  • Error using migration assistant and time machine

    Daughter dropped water on our old macbook pro.  Got a new one and trying to restore using backups to our time capsule, but we are receiving this error using the migration assistant: "Make sure that all of your network devices are connected and turned on. It appears that some backups are already in use. If you don't see the backup you need, make sure it is not currently mounted by another machine and try again."
    any suggestions on how to transfer the data from time capsule to new macbook?

    Do you see the backups in the Select Your Disk window? 
    If so, can you connect to them?
    Make sure Time Machine is OFF on all Macs on your network.  If any backups are trying to run, cancel them.  If they won't cancel after a few minutes, see #D6 inTime Machine - Troubleshooting.
    Also be sure no other Mac is looking at them.  If you continue to get that message, disconnect all users, per #C12 in the same article.
    If none of that helps, the backups may be damaged (could have happened when the old Mac died).  Try to Repair them, per #A5 in Time Machine - Troubleshooting

  • Azure Machine Learning : API for management (of experiments)

    Hello there,
    Not sure if I'm missing something, but I haven't found a way to create / alter an experiment via API and/or PowerShell commands (like we can define do via JSON/PowerShell in ADF).
    I would also like to be able to publish / republish an experiment the same way to update a deployed service.
    Thanks a lot ;)

    Hello Yordan,
    Thanks for the quick answer.
    Do you know if that's something in the plan? Any idea of a timeline you can share?

  • Work with reader in Machine learning

    hi,
    i am doing work on azure machine learning, and i found one doubt, suppose i have 100 records right now and i create experiment. it gives me some result.
    now suppose after 2-3 days i have 2000 records so do i have to run the experiment again to use large scale of data or azure machine learning experiment will get those newly added records when i call web service using RRS.
    Please provide some guidance.

    When you train the service on the new 2000 records the model will be re-trained from scratch. That is, the knowledge obtained from the old 100 records will be lost.
    The feature you're talking about is called
    incremental/online learning, which is something we don't support yet.
    -Y-

  • Is there any one who knows how to apply machine learning algorithms to the spectrum data collected using ni usrp for ism band to use spectrum efficiently by link adaptation

    Hi,
    may i know any one working in cognitive radio research and applying machine learning techniques using the spectrum data collected from NI usrp kits

    Can't edit my message anymore, so for the tldr crowd (too long didn't read), here is a shorter version:
    The good:
    E4200 worked fine for about 15 hours with great throughput and link quality (with one brief disconnect in the middle - online gaming software shows brief disconnects that otherwise go totally unnoticed).
    The bad:
    Wireless on the E4200 stopped broadcasting entirely (to a Windows 7 laptop with a 802.11n 2.4 GHZ USB adapter).
    I had switched between two adapters that use the same chipset, same driver and in fact show up as a single device in device manager) without rebooting the router but it worked (fine) for an hour after I swapped the adapters.
    Right before I rebooted it, I checked and the E4200 was not hot to the touch and wired internet was still working after the wireless radio stopped working.
    A reboot of the router cured it.
    The open question as to the root cause:
    Now I want to know whether this wireless radio ceasing to broadcast (requires a reboot of the E4200) will happen daily?
    I.e. I want to know whether it it really is overheating (then again why would only some have that problem needing to reboot daily while others have gone weeks with the E4200 without a single reboot being needed and without any problems occurring) or whether it had to do with changing the adapters back and forth without rebooting the router. Keep in mind that the router worked fine for an hour or so after I stopped swapping the adapters.
    Extra question:
    Will getting a Cisco AE1000 USB adapter perhaps help? (I know this is a loaded question and their is no easy / sure answer, but even a "maybe" or reasons why it might help at this point would be better than nothing.
    Any similar experiences (with the router needing to be rebooted to get wireless radio back on) would be appreciated as it may help myself and others experiencing these types of issues.

  • Accessing/processing geospatial data types in Azure cloud services using Python

    Hi
    We are creating a cloud-services in Azure using Python and Django,
    and are trying to store the geospatial data into SQL Database,
    however Django doesn't not have a built-in spatial data support (unless we use GeoDjango, which doesn't support sqlserver through odbc)
    scenario:
    1. user saves current location, stored in column (geography/geometry type)
    2. user will also do some geospatial query (intersect)
    what is the preferred solutions for this? Python or .Net for azure ?

    Based on what you wrote, my understanding is that you will need to craft the queries yourself no matter whether you use Python or .Net (C#). Python might appear to be a simpler approach because you can stay in the same development environment. The benefit
    of the Microsoft .Net/C# approach that I can see is that both layers in your stack are then officially supported by Microsoft.
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • When I sign in to Gmail in FF I get this mess -Error undefined If this problem persists, try reloading the page, or using the basic HTML version. Learn More.

    When I sign in to Gmail in FireFox I get this mess -Error undefined If this problem persists, try reloading the page, or using the basic HTML version. Learn More.

    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Press and hold Shift and left-click the Reload button.
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (MAC)
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Microsoft Azure for machine learning on data collected from microsoft spectrum observatory

    Dear Sir,
    Can any one please suggest how shall I apply Microsoft Azure for applying machine learning techniques on spectrum data available from Microsoft spectrum observatory . Please send a mail.
    Regards,
    pavan

    Hi Pavan!
    Apologies, I'm not familiar with MSO - how are you collecting the data provided there? Is there an API? Do you have access to the raw data?
    Regards,
    AK

  • Access denied error while running opening remote power-shell session from one azure machine to another

    We are trying to open a remote power-shell session from one azure machine to another azure machine and that is failing with the following error. Any ideas?
    Observations: -
    If the worker role is running under network service or local system, then it fails.
    We emulated the same behavior from a stand-alone exe and that also failed when the exe was run under network service or local system.
    If we run the same stand-alone exe from a user account, then it works.
    Unhandled Exception: System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server sampleapprm.cloudapp.net failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting
    Help topic.
       at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
       at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.EndOp
    en(IAsyncResult asyncResult)
       at System.Management.Automation.Runspaces.Internal.RemoteRunspacePoolInternal
    .Open()
       at System.Management.Automation.RemoteRunspace.Open()
       at ConsoleApplication2.Program.Main(String[] args)

    Hi,
    This error only show access is denied, and it is hard for me to deal with this issue, may be Windows Powershell forum or Windows Azure VM are good forums for you, could you give more details information to us for a better help if this issue
    was related with windows Azure.
    Best Regards
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Machine Learning Text Analytics Service - Maximum String Length

    In the documentation here: http://azure.microsoft.com/en-us/documentation/articles/machine-learning-apps-text-analytics/
    it doesn't provide a max length value for the string parameters. In other words, what's the largest string I can upload to the API?
    Thanks,
    ATOMBOMB

    As far as HTTP protocol can support it. For e.g. if you are using OData endpoint with get, then max will be determined by URI length.

  • Performance of Machine Learning Webservice API

    Hi Team,
    I have some questions about the performance of Machine Learning Web Service API.
    I've recently grabbed the tweeter sentiment analysis model sample and tested the web service performance in both single request/response and batch execution mode. Based on the result, single request API takes about 5 seconds to process one
    tweet, which is not applicable to real-time processing as the speed that tweet get generated is much faster than this. So I have to buffer tweet stream and send batch execution requests which takes about 0.25 sec per tweet when sending 500 tweets per batch.
    The questions are:
    1. Given a task such as tweeter sentiment analysis, can the API running under single request mode do better than a few seconds per record, in order to enable real-time processing? Currently I am using the free version ML service.
    Could standard version have better performance in terms of processing single web service request?
    2. How to evaluate the performance and estimate the execution time/pricing of a model built on Azure ML? From the pricing web page it says "The best way to estimate prediction API call times is to benchmark a model on the Machine Learning
    service.". Can anyone explain this a bit more in details about how to "benchmark a model" ?
    Thanks

    Hi Dexter,
    It is likely that the initial calls to the web service are triggering model initialization and are taking longer than steady state calls. To measure the performance of a fully initialized service - you would need to send multiple concurrent requests at once.
    There is an unofficial tool that helps you do this today:
    https://github.com/paveldournov/RRSWarmer but you can do that with simple client code as well.
    There is an option in the ML APIs to send multiple entries (tweets in your case) in a single request to the Request/Response service. In this case - all of the entries will be sent to the model at once, which can be faster per each tweet, while it will not
    require asynchronous batch processing. Sending 500 entries per call in this case should not be a problem.
    The free workspace allows you to build services that can scale only to 4 concurrent calls at a time. A paid workspace will allow scaling this to 20 concurrent calls by default, and to 200 with an API call to adjust the max concurrent calls. The performance
    of an individual call should not change with going from Free to Paid, but the amount of call volume and rps is up to 50 times more in the Paid case.
    Re. the pricing - the resources on this page are outlining the key pricing points:
    http://azure.microsoft.com/en-us/pricing/details/machine-learning/ . The API pricing is composed out of two components - the number of calls and the time to process the calls.
    I'd recommend to setup a web service and do perf testing of the service from a single client sending serialized requests. This will allow you to measure the compute time per call. Then a simple multiplication by the expected number of calls should give
    an idea about the total cost.
    Thanks!

Maybe you are looking for

  • PLEASE HELP!! iMac not working

    Help required!!! I'll start from the beginning, Last Friday I had an issue with accessing my wireless network from my iMac, I called my ISP (Virgin Media) who asked me to hard wire the mac to the router, I had to move the mac from its desk to next to

  • Xserve - A week of uncertainty

    A week since the announcement and I see no clear guidance from Apple. My contemplative confusion is turning into apprehension for the loss of what we had and a sense of uncertainty about the products that my business thrives on supporting. Is Apple n

  • Iphoto emailing and "events" issue

    I am not sure if these issues are related.  2 weeks ago I began having and issue where 3 of my events had no key image.  It also said there were 0 photos in the event.  If you clicked on the event, you could still see there were photos in there.  I d

  • Tune up app has wrecked my iTunes collection, any ideas on how to restore my library?

    Having a nightmare with itunes and an app they call Tuneup Tune up recently did an automatic update and proceeded to scan my itunes library with a thing they are calling automagic, great I thought... but what a mess it has made, Its split albums into

  • Fade for size jitter in shape dynamics doesn't work

    I have CS6.  I used to be able to fade out brushes under the Size Jitter in Shape Dynamics but can't now.  I open up CS3 and I can do it in there.  Any idea why it isn't working in CS6?