locked
Locale problem (Turkish) in some examples RRS feed

  • General discussion

  • I am posting this for future reference to other people (probably from Turkey).

    I was getting several exceptions when running application examples in example browser. (I will put the exceptions below for reference) Had the same exceptions when I tried to run the sample from a new solution in visual studio. Ironically, same examples worked in my laptop flawlessly.

    One more data to the problem; I am in Turkey. My PC has Turkish locale while my laptop has US.

    So, briefly, Infer.Net fails the "Turkey Test". Please see details here: http://www.codinghorror.com/blog/2008/03/whats-wrong-with-turkey.html

    The problem is with the i > İ and ı > I in Turkish.  

    Anyway, the workaround solution is to add the following lines to the start of your app:

    System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
    		System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture;

    Here is the exception log I get in Example Browser for WetGlassSprinklerRain

    Compiling model...compilation failed.
    Example failed with exception: MicrosoftResearch.Infer.CompilationFailedException: MessageTransform failed with 3 error(s) and 0 warning(s):
    Error 0: This model is not supported with ExpectationPropagation due to Gate.CasesInt(bool[] casesInt, int i, int count). Try using a different algorithm or expressing the model differently in
    Gate.CasesInt(Cloudy_N__selector_uses[0], 2)
    Details: System.MissingMethodException: iAverageConditional not found in IntCasesOp using parameter types: [casesInt] DistributionStructArray<Bernoulli,bool>,[to_casesInt] DistributionStructArray<Bernoulli,bool>,[i] Discrete,[to_i] Discrete,[count] int,[result] Discrete
    Error 1: This model is not supported with ExpectationPropagation due to Gate.CasesInt(bool[] casesInt, int i, int count). Try using a different algorithm or expressing the model differently in
    Gate.CasesInt(Sprinkler_N__selector_uses[0], 2)
    Details: System.MissingMethodException: iAverageConditional not found in IntCasesOp using parameter types: [casesInt] DistributionStructArray<Bernoulli,bool>,[to_casesInt] DistributionStructArray<Bernoulli,bool>,[i] Discrete,[to_i] Discrete,[count] int,[result] Discrete
    Error 2: This model is not supported with ExpectationPropagation due to Gate.CasesInt(bool[] casesInt, int i, int count). Try using a different algorithm or expressing the model differently in
    Gate.CasesInt(Rain_N_cond_Sprinkler_N__S_selector_uses[0], 2)
    Details: System.MissingMethodException: iAverageConditional not found in IntCasesOp using parameter types: [casesInt] DistributionStructArray<Bernoulli,bool>,[to_casesInt] DistributionStructArray<Bernoulli,bool>,[i] Discrete,[to_i] Discrete,[count] int,[result] Discrete
    
       at MicrosoftResearch.Infer.ModelCompiler.GetTransformedDeclaration(ITypeDeclaration itd, MethodBase method, AttributeRegistry`2 inputAttributes) in C:\infernetBuilds\28-09-2012_14-31\Compiler\Infer\ModelCompiler.cs:line 462
       at MicrosoftResearch.Infer.ModelCompiler.CompileWithoutParams(ITypeDeclaration itd, MethodBase method, AttributeRegistry`2 inputAttributes) in C:\infernetBuilds\28-09-2012_14-31\Compiler\Infer\ModelCompiler.cs:line 499
       at MicrosoftResearch.Infer.InferenceEngine.Compile() in C:\infernetBuilds\28-09-2012_14-31\Compiler\Infer\InferenceEngine.cs:line 189
       at MicrosoftResearch.Infer.InferenceEngine.GetCompiledInferenceAlgorithm(Boolean inferOnlySpecifiedVars, IVariable var) in C:\infernetBuilds\28-09-2012_14-31\Compiler\Infer\InferenceEngine.cs:line 532
       at MicrosoftResearch.Infer.InferenceEngine.InferAll(Boolean inferOnlySpecifiedVars, IVariable var) in C:\infernetBuilds\28-09-2012_14-31\Compiler\Infer\InferenceEngine.cs:line 447
       at MicrosoftResearch.Infer.Tutorials.WetGlassSprinklerRainModel.ProbRain(Nullable`1 cloudy, Nullable`1 sprinkler, Nullable`1 wet, Dirichlet probCloudyPrior, Dirichlet[] cptSprinklerPrior, Dirichlet[] cptRainPrior, Dirichlet[][] cptWetGrassPrior)
       at MicrosoftResearch.Infer.Tutorials.WetGrassSprinklerRain.Run()
    

    • Changed type Koray Balci Wednesday, December 26, 2012 8:39 AM Issue in Infer.net, not a real question
    Tuesday, December 25, 2012 7:26 PM

All replies

  • Many thanks for bring this to our attention Koray. I have logged a bug for this.

    John

    Wednesday, January 2, 2013 8:56 AM
    Owner