locked
Problem with fastrtext R library on Azure ML Studio using Microsoft R Open environment 3.4.4 RRS feed

  • Question

  • I successfully installed on Azure ML Studio the "fastrtext" (https://cran.r-project.org/web/packages/fastrtext/index.html) R library following this post https://gallery.azure.ai/Experiment/How-to-Use-XGBoost-in-Azure-ML-1

    fastrtext is a wrapper of the well known fastText Facebook library for word embedding and text classification.

    I needed to change the standard R version on Azure ML Studio, i.e. CRAN R 3.1, with the newer Microsoft R Open Studio 3.4.4, because fastrtext depends on R environment >= 3.3 

    Now, within an "Execute R script" block, when I try to learn my own word embedding, using the predefined "execute()" function available in fastrtext, I get the error below

    • RPackage library exception: Attempting to obtain output before invoking process (Error 1000)

    Strangely enough for certain parameters (like e.g. small number of epochs and small dimension of the embedded word vectors), the "Execute R script" is successfully executed without errors. Unfortunately, with the parameters I need in order to learn "good" word embeddings, I unexpectedly get the aforementioned error.

    I have of course tested the code in the "Execute R script" block on my local machine, and everything works fine, also using the parameters I need in the "execute()" function - that is, large number of epochs (50) and word embedding dimension (100). 

    Does anybody know what the problem is here? 

    Any help would be highly appreciated! 

      



    • Edited by _mm_86 Tuesday, December 11, 2018 11:31 PM
    Tuesday, December 11, 2018 11:24 PM

Answers

  • I actually found out that this is due to a minor issue in the fastrtext library which, on some non-Unix machines, throws an error whenever the learning rate parameter "lr" is equal exactly to 1 (upper bound). For 0<lr<1, the function "execute()" works just fine and it is possible to generate successfully word embeddings as well as train and test supervised text classification models.

    Kind regards

    _mm_86

    • Marked as answer by _mm_86 Wednesday, December 19, 2018 9:01 PM
    Wednesday, December 19, 2018 9:01 PM

All replies

  • Hi,

    There's an article about diagnosing such issues, please refer this :

    https://blogs.msdn.microsoft.com/andreasderuiter/2015/02/03/troubleshooting-error-1000-rpackage-library-exception-failed-to-convert-robject-to-dataset-when-running-r-scripts-in-azure-ml/

    Let us know if this helps, else we can gladly probe in further.

    Monday, December 17, 2018 12:57 PM
  • I actually found out that this is due to a minor issue in the fastrtext library which, on some non-Unix machines, throws an error whenever the learning rate parameter "lr" is equal exactly to 1 (upper bound). For 0<lr<1, the function "execute()" works just fine and it is possible to generate successfully word embeddings as well as train and test supervised text classification models.

    Kind regards

    _mm_86

    • Marked as answer by _mm_86 Wednesday, December 19, 2018 9:01 PM
    Wednesday, December 19, 2018 9:01 PM