locked
Problem with mono(Linux) RRS feed

  • Question

  • Hi

    I'm trying to use Infer.NET on linux because i need to run a model into a server(University server).

    I'm currently using monoDevelop as editor because i'm not so prepared in using mono and all the correlate packages on linux. BTW, I've solved a lot of issues concerning on this transferring from windows to linux, but, running also the simplest project(FirstExample) below, i got this kind of error:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using MicrosoftResearch.Infer.Models;
    using MicrosoftResearch.Infer;
    
    namespace MicrosoftResearch.Infer.Tutorials
    {
    	public class FirstExample
    	{
    		public static void Main()
    		{
    			
    			Variable<bool> firstCoin = Variable.Bernoulli(0.5).Named("firstCoin");
    			Variable<bool> secondCoin = Variable.Bernoulli(0.5).Named("secondCoin");
    			Variable<bool> bothHeads  = (firstCoin & secondCoin).Named("bothHeads");
    			InferenceEngine ie = new InferenceEngine();
    			if (!(ie.Algorithm is VariationalMessagePassing))
    			{
    				Console.WriteLine("Probability both coins are heads: "+ie.Infer(bothHeads));
    				bothHeads.ObservedValue=false;
    				Console.WriteLine("Probability distribution over firstCoin: " + ie.Infer(firstCoin));
    			}
    			else
    				Console.WriteLine("This example does not run with Variational Message Passing");
    		}
    	}
    }
    

    Unhandled Exception: System.TypeLoadException: A type load exception has occurred.
      at MicrosoftResearch.Infer.Models.Variable`1[MicrosoftResearch.Infer.Distributions.Bernoulli].set_ObservedValue (Bernoulli value) [0x00000] in <filename unknown>:0
      at MicrosoftResearch.Infer.Models.Variable.Constant[Bernoulli] (Bernoulli value) [0x00000] in <filename unknown>:0
      at MicrosoftResearch.Infer.Models.Variable.Bernoulli (Double probTrue) [0x00000] in <filename unknown>:0
      at MicrosoftResearch.Infer.Tutorials.FirstExample.Main () [0x00000] in /home/marco/Desktop/Infer.NET 2.5/Samples/ExamplesBrowser/FirstExample.cs:14
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred.
      at MicrosoftResearch.Infer.Models.Variable`1[MicrosoftResearch.Infer.Distributions.Bernoulli].set_ObservedValue (Bernoulli value) [0x00000] in <filename unknown>:0
      at MicrosoftResearch.Infer.Models.Variable.Constant[Bernoulli] (Bernoulli value) [0x00000] in <filename unknown>:0
      at MicrosoftResearch.Infer.Models.Variable.Bernoulli (Double probTrue) [0x00000] in <filename unknown>:0
      at MicrosoftResearch.Infer.Tutorials.FirstExample.Main () [0x00000] in /home/marco/Desktop/Infer.NET 2.5/Samples/ExamplesBrowser/FirstExample.cs:14
    The application was terminated by a signal: SIGHUP

    *******

    I've no build error; i have linked the dll library (Infer.Compiler, Infer.Runtime), but the problem is still present.

    The problem start every time i call a method from the class Variable. I've tried also with different method as Variable.Gaussian... etc. but the problem is still present.

    -Does anyone ever had this kind of problem??

    -Does anyone know i to fix it??

    -Does anyone have an example of a model working on linux with mono??

    Thank you in advance

    Marco

    Saturday, May 18, 2013 12:33 PM