Coder Social home page Coder Social logo

Errors in Uity Editor about vehiclex HOT 19 CLOSED

muaz-urwa avatar muaz-urwa commented on June 5, 2024
Errors in Uity Editor

from vehiclex.

Comments (19)

yorkeyao avatar yorkeyao commented on June 5, 2024 1

I think I know what is the error and sorry for not making it clear. What I mean is to replace original RawImage.cs with contents of ./Script/RawImage.cs, not to replace PosAgent.cs with the contents of ./Script/RawImage.cs. The reason for such replacement is I modified some content in RawImage.cs where it is the part of the source code of the Unity engine. So I cannot include RawImage.cs in my project directly.

I will try some alternative ways to implement it in the future.

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024 1

Oh many thanks. I have updated this link.

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024 1

I haven't test unity editor in Linux (unity editor just begin to support Linux last year when I write this code). I just rebuild my system in windows it seems works well (by replacing Unity/Hub/Editor/2019.3.0a8/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Rawimages.cs with ./Script/RawImage.cs).

May I ask is this an error during running? it seems there is still something wrong with the RawImage.cs

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024 1

Cool! I have updated the readme.

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024

Thank you for your question. Could you please click the 'Clear' button above and see how many error remain?

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Screenshot from 2020-09-09 18-22-29

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024

It seems weird to me that you have this bug. Could you please check whether PosAgent.cs is removed here?
Capture

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Screenshot from 2020-09-09 19-28-42

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Great, that resolved the issue. Thank you so much !

I noticed that linux standalone binary is missing.

Both links on this page point to the windows binary on google drive.

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Great. Thank you.

I get the same car in all images when I run inference.py using the unity editor by replacing

env = UnityEnvironment(file_name=env_name)

with

env = UnityEnvironment(file_name=None)

car_id is always 0, color_id is always 4 and type_id is always 0.

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024

There should be some bugs. Could you please go to the console and check the error?

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

I have not downoaded the background images, so i repeatedly get this error on console:

DirectoryNotFoundException: Could not find a part of the path '/home/urwa/Documents/unsupervised/VehicleX/unity/VehicleX Unity Source/Background_imgs/vdo (37).avi'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at :0)
System.IO.FileSystemEnumerableIterator1[TSource].HandleError (System.Int32 hr, System.String path) (at <a8ed250850854b439cedc18931a314fe>:0) System.IO.FileSystemEnumerableIterator1[TSource].CommonInit () (at :0

Could this be the reason ?

Using Build-linux/VehicleX is also giving me one car.

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Missing background images was the reason.

IEnumerator Example(float[] vectorAction) function in PosAgent.cs encounters an error if background images are missing. And then rest of function does not execute.

Your inference script has an exception ensuring that BackgroundImages folder exists. I removed it, that is why I wasnt getting exception.

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024

Yes, the inference mode requires background images. otherwise, you can have ''python inference.py --train_mode True''

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Now I am able to run using the linux standalone version.

But using the unity editor I get the following error.

NullReferenceException: Object reference not set to an instance of an object
PosAgent+d__24.MoveNext () (at Assets/Scripts/PosAgent.cs:215)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /home/builduser/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PosAgent:AgentAction(Single[], String) (at Assets/Scripts/PosAgent.cs:310)
MLAgents.Agent:AgentAction(Single[], String, CustomAction) (at Assets/Resources/ML-Agents/Scripts/Agent.cs:872)
MLAgents.Agent:AgentStep() (at Assets/Resources/ML-Agents/Scripts/Agent.cs:1069)
MLAgents.Academy:EnvironmentStep() (at Assets/Resources/ML-Agents/Scripts/Academy.cs:562)
MLAgents.Academy:FixedUpdate() (at Assets/Resources/ML-Agents/Scripts/Academy.cs:583)

Errors occur when script tries to access attributes of Background_Img such as: Background_Img.m_Texture

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

following line in start() in POsAgent.cs returns Null.

GameObject.FindGameObjectWithTag("Background_Img").GetComponent<UnityEngine.UI.RawImage>();

from vehiclex.

yorkeyao avatar yorkeyao commented on June 5, 2024

I think the Unity editor is only available in windows. May I ask do you get the same error in windows system?

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Do you mean that this repository only supports the linuxx unity editor ?

I am able to perform the inference using linux and unity editor but I get images of the same car over and over again. Because of the error I mentioned above.

Background_Img GameObject has no component of type <UnityEngine.UI.RawImage> and returns null. It doesnt lool like an OS issue.

I will try on windows too and let you know.

from vehiclex.

muaz-urwa avatar muaz-urwa commented on June 5, 2024

Ah thank you so much !

I was copying the rawimage in to the wrong place assets/scripts

It is working like a charm now !

I you can put the path "Unity/Hub/Editor/2019.3.0a8/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Rawimages.cs" in the readme instructions it would be very easy for newbies to Unity.

Thanks again !

from vehiclex.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.