Image tagging U-SQL failure


  • Hi forum,

    I'm trying to get a U-SQL query to work, but get this error when i run the query:

    Bad type in Set<T> method, column: Tags, index: 2, expected: Microsoft.Analytics.Types.Sql.SqlMap`2[System.String,System.Nullable`1[System.Single]], actual: System.String

    I have used a query from a tutorial which looks like this:


        REFERENCE ASSEMBLY ImageCommon;
        REFERENCE ASSEMBLY ImageTagging; 

        @imgs =
            EXTRACT FileName string, ImgData byte[]
            FROM @"/Pictures/{FileName}.jpg"
            USING new Cognition.Vision.ImageExtractor();

        //  Extract the number of objects on each image and tag them 

        @TaggedObjects =
            PROCESS @imgs 
            PRODUCE FileName,
                    NumObjects int,
                    Tags SQL.MAP<string, float?>
            READONLY FileName
            USING new Cognition.Vision.ImageTagger();

        @result1A = 
            SELECT  FileName,
                    T.key AS Content,
                    T.value AS Confidence
            FROM    @TaggedObjects
            CROSS APPLY EXPLODE (Tags) AS T(key, value);

        OUTPUT @result1A 
        TO "/ImageTags.csv"
           USING Outputters.Csv();

    Do any of you know what causes this error?

    Tuesday, October 24, 2017 8:55 AM

All replies

  • This may be that you have an older version of the U-SQL Extensions installed.

    Reinstall them and try again. The latest samples are here:

    Monday, December 11, 2017 4:18 PM