Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by hassanhaija · Jun 24, 2011 at 09:47 PM · kinect

Unity/Kinect with Infer.net

Hello,

I'm working on a project using Unity with Microsoft Kinect (using OpenNI/NITE) and Microsoft infer .net machine learning tool to create some body gesture recognition using Kinect. I used the sample project with NITE as a start for unity and it works fine. The problem is when I tried to add the Infer .net dlls.

I am using Unity 3.2 pro. I copied all the dlls from the infer.net folder to the assets folder in my project. it first complained about some dlls from system (I don't know why ?) so I copied them to the assets as well (System.deplyment.dll , system.windows.forms.dll).

Finally the compiler was ok with all the classes and types. I compile in VS2010 and everything is ok. but when I play the program in Unity it gives me this error :

     InvalidProgramException: Errors found when compiling algorithm: 
 MicrosoftResearch.Infer.ModelCompiler.CompileWithoutParams (ITypeDeclaration itd, System.Reflection.MethodBase method, MicrosoftResearch.Transforms.AttributeRegistry`2 inputAttributes)

and the log is

 platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\Mono.Security.dll (this message is harmless)
 Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\System.Runtime.Serialization.Formatters.Soap.dll (this message is harmless)
 Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\Mono.Posix.dll (this message is harmless)
 Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\Microsoft.JScript.dll (this message is harmless)
 Compilation failed with 3 error(s)(0,0) : error CS0006: cannot find metadata file `data-0AF40020'
 (0,0) : error CS0006: cannot find metadata file `data-18E90020'
 (0,0) : error CS0006: cannot find metadata file `data-12CB0020'
 InvalidProgramException: Errors found when compiling algorithm: 
   at MicrosoftResearch.Infer.ModelCompiler.CompileWithoutParams (ITypeDeclaration itd, System.Reflection.MethodBase method, MicrosoftResearch.Transforms.AttributeRegistry`2 inputAttributes) [0x00000] in <filename unknown>:0   at MicrosoftResearch.Infer.InferenceEngine.Compile () [0x00000] in <filename unknown>:0   at MicrosoftResearch.Infer.InferenceEngine.BuildAndCompile (Boolean inferOnlySpecifiedVars, IEnumerable`1 vars) [0x00000] in <filename unknown>:0   at MicrosoftResearch.Infer.InferenceEngine.GetCompiledInferenceAlgorithm (Boolean inferOnlySpecifiedVars, IVariable var) [0x00000] in <filename unknown>:0   at MicrosoftResearch.Infer.InferenceEngine.InferAll (Boolean inferOnlySpecifiedVars, IVariable var) [0x00000] in <filename unknown>:0   at MicrosoftResearch.Infer.InferenceEngine.Infer[VectorGaussian] (IVariable var) [0x00000] in <filename unknown>:0   at BPM.InferW (System.Collections.Generic.List`1[] xValuesData) [0x0005e] in G:\study\kinect project\Unity kinect\Assets\scripts\BPM.cs:252   at BPM.Train (System.Collections.Generic.List`1[] xValuesData) [0x00069] in G:\study\kinect project\Unity kinect\Assets\scripts\BPM.cs:231   at BPMtest.Test_BPM (Int32 nClass, Int32 totalFeatures, Double noisePrec, System.String fileName, MicrosoftResearch.Infer.Maths.Vector[] testData) [0x00048] in G:\study\kinect project\Unity kinect\Assets\scripts\BPMtest.cs:58   at BPMtest.Start () [0x000c1] in G:\study\kinect project\Unity kinect\Assets\scripts\BPMtest.cs:38 

 

Any Ideas ?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ckfinite · Jun 24, 2011 at 09:48 PM 0
Share

Please, don't post the same question more than once.

avatar image hassanhaija · Jun 24, 2011 at 10:08 PM 0
Share

I'm sorry .. there seemed to be a problem with my internet connection. Everytime I was posting the question the respond was "sorry internal error." So I was trying again and didn't notice it was already posted. Sorry again :)

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Dreamora · Jun 24, 2011 at 10:49 PM

The error unhappily does not say much as such. You won't be able to avoid to ask on the infer related pages (after checking its docs) on why it would fire that exception ie what could lead there.

Once you know that we can likely point you to the root on the unity side that lead there

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hassanhaija · Jun 25, 2011 at 12:23 AM 0
Share

this is the Error is was showing me before :


-----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/07d54f8f8fbca08489dbb7a783d5378c.dll

The following assembly referenced from G:\study\kinect project\Unity kinect\Assets\Infer\Infer.Runtime.dll could not be loaded:

  Assembly:   System.Windows.Forms    (assemblyref_index=2)

  Version:    2.0.0.0

  Public $$anonymous$$ey: b77a5c561934e089

The assembly was not found in the Global Assembly Cache, a path listed in the $$anonymous$$ONO_PATH environment variable, or in the location of the executing assembly (G:\study\kinect project\Unity kinect\Assets\Infer).


so I just copied the "System.Windows.Forms" from the .net directory to the unity assets. Does this mean that it have some kind of different .net versions or something. I think this is what is making the error cz it shouldn't be like that ?!

avatar image
2

Answer by Dreamora · Jun 25, 2011 at 12:27 AM

Oh I missed that part that you really copied the Windows.Forms.

You can't use Windows.forms with Unity at all and as such also no library that has a relationship to it. Not only is this library you copied for MS.NET and not even mono, but also it has various deep system dependencies which won't work out with unity.

Question is also why you need it cause Windows Forms is for the Windowing system etc, thats not a "just to be used" assembly aspect, which would imply that one of the libraries or an aspect of it is meant to show windows or dialogs. perhaps there is a library to "just use"?

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hassanhaija · Jun 25, 2011 at 01:42 AM 0
Share

ok .. After trying many things. I removed everything from the assets and just copied the dlls from the infer .net release folder. The compiler didn't complain about the missing windows.forms lib anymore. But when I run the same old error still shows up.

InvalidProgramException: Errors found when compiling algorithm

But in the log now there is only 1 missing metadata file is$$anonymous$$d of 3 before. So we made some progress :) .

Compilation failed with 1 error(s) (0,0) : error CS0006: cannot find metadata file `data-07200020'

Any Idea what this could be. could it be a version problem with .Net dlls. I need any help possible. Because if this doesn't work I have to move to use something else with unity.

avatar image Dreamora · Jun 25, 2011 at 01:52 AM 2
Share

I've no idea where this one comes from but I would guess from the infer compilation step and then it gets placed at the wrong place or is not included in the build at all. you might want to check where the compiled data files from infer are expected to be found and move them there manually for testing, if that works you can later on automate the step through a build post process script

avatar image hassanhaija · Jun 25, 2011 at 02:46 AM 0
Share

seems exactly just like you said :) .. I tried some work around and it worked. Thank you very much .. i wouldn't have found it without you . I will try to post my last solution if everything will work out.

avatar image Dreamora · Jun 25, 2011 at 02:58 AM 0
Share

Glad it helped :)

Looking forward to what you create with it :)

avatar image hassanhaija · Jun 25, 2011 at 10:14 PM 0
Share

ok I can see the problem now. infer generates a source code file first then compiles it to build it's algorithm. Now the problem is that infer is creating it's source code file outside the assets folder on the project root (the infer documentation says in "bin\\debug" folder. So maybe unity can't access that file after since it's not in it's assets folder and it stops infer from using it. $$anonymous$$y question is: Is there a way to change the working or maybe execution (I don't know what that is called) directory of unity project to be inside the assets folder? I don't think there is way to change that from infer's side.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

is there a way to clamp the Z information in unity with zigfu or ETC, so people don't get caught until a distance ? 0 Answers

Assigning Kinect joints to unity character 0 Answers

Kinect+unity3D 1 Answer

softkinetic is not detected 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges