Unity machine learning using internal brain for pre-trained networks results in crash - unity3d

I try to get the machine learning project of Unity running. The project can be found here: https://github.com/Unity-Technologies/ml-agents
Following all the necessary steps to set everything up, everything works fine until I try to use a pre-trained model in an internal brain, e.g in the 3D-Ball example. On pressing play in the editor, it says to have stopped working and the editor crashes. Same goes for a successfully compiled executable.
Since I can't find any crash logs, I absolutely don't know what's the cause to this. Anybody had the same issue and solved it, or any ideas on this?
I'll just add the steps I made to set my project up, in case somebody wants to reproduce or check for mistakes I made:
Download zipped project from github
Open project with Unity 2018.1.1f1
Add ENABLE_TENSORFLOW to predefined symbols
Download and install TensorflowSharp Plugin
In the 3DBall Scene select the brain and switch BrainType to Internal
Run in editor or compile and run, results both times in a crash
EDIT
What's making me wonder is that I got it working just fine training an external brain in python using a compiled executable. So my thoughts were it should be much more easy to just forward pass a trained net, if it's working doing forward pass and back propagation. But it says though that external brain still is experimental, so not sure if that just will not work until some future patches.
EDIT 2
So I tried using an internal brain in an older version of the githubs project, which then worked quite fine. Also I used an older version of the TensforflowSharp Plugin. I'll try to figure out, which version still works and gonna post my results here ;)

To conclude, the problem was actually the recent version of the TensorflowSharp Plugin. Using an older version, which I found somewhere worked fine. I don't have the link to that version anymore, but in case someone experiences the exact same problem, I could search for it or upload it somewhere.

Related

Unity framework for SwiftUI "Oddly Stepping" error in iOS 16.1

I am using Unity as a library for SwiftUI quite a while now. However when updating to the newest iOS version (16.1) it stopped working. Compiling runs without a problem but during runtime I get an error when Unity is starting:
in:
I even started a completely new project with Unity included to SwiftUI and get the same error. As this is some kind of assembler code and I certainly do not know how to read it I don't really know where I have to start searching.
In the console I get: "warning: UnityFramework was compiled with optimization - stepping may behave oddly; variables may not be available." I tried several ways to turn off optimization as described in related questions which did not work. When unchecking "Debug" in the scheme options the project starts normally
A similar thing happened to me. I'm not entirely sure if it's the same problem but in the console, I got a message saying UnityFramework is running optimized and may behave oddly. Unfortunately, I've tried a couple of ways to disable optimization but I've yet to find a solution.
For now, I'm able to bypass this error by disabling the debugger entirely. In order to do this, you have to go to Product -> Scheme -> Edit Scheme and uncheck debug executable.
I'm not sure if this will work for you but I figured it'd be worth a shot!

Advice to fix 'No such module' issues for pods in Xcode project

I'm facing this No such module 'SomeModule' error in an XCode solution that I've inherited from some other developers. Initially the error is No such module 'ObjectMapper', but I find that if I swap the position of that line with the one below, it becomes No such module 'Alamofire'.
I've tried all the simple things suggested on this site (and others), making sure I'm opening the .xcworkspace file, deleting everything and re-installing (derived data, the whole Pods directory, etc.), updating cocoapods, etc.
I suspect that what's actually going on is that either the pods themselves aren't building, but for some reason the errors there are making their way to XCode's obtuse errors list, or that they are building but somehow not being linked correctly.
This is actually a project I've inherited from some other developers, so it's hard to know what weird or wonderful configuration they've done to break things. They are using an approach that I've not seen before where there's 3 build schemes for different environments (in this case Develop, Stage and Prod) then this kind of parent scheme for all the other three.
I've also tried going to 'Manage Schemes' then ticking the 'Show' checkbox for the Pods-Sunflower project. When I try to build just that project, I get a bunch of errors (mainly for Facebook, Google and Realm pods) that say things like:
Unable to load contents of file list: '/Target Support Files/FBSDKCoreKit/FBSDKCoreKit-xcframeworks-input-files.xcfilelist'
I don't expect anyone will be able to provide me a set of steps on how to solve this issue (I mean, that would be great), but I am hoping that someone can help me find ways to just work out what the problem is here, like:
How can I verify that all the separate pods are actually building?
Is there some folder where I can see all the built pods?
When you get a No such module 'SomeModule' error, where is Xcode trying to find the modules (like, in the file system? where?)
Thanks. I know this is one of those perennial issues, appreciate any advice.
The solution which worked for me was:
First thing i do when i got project from another developer is make a copy of pods and completely delete following files
Podfile
Pods folder
Podfile.lock
xcworkspace
In case you already once use that same project try deleting derived data
After deleting pods, reinstall pods and open project and let xcode do indexing of your project and after indexing look left side where warnings and errors shows, In there sometime you just have to just click and update or convert whatever xcode suggesting.
Note: - Sometimes doing same thing doesn't work try changing sequence because its xcode sometimes become dumb. Also try restarting
Honestly in these situation all i do is hit and try.
But above steps generallt works for me.

LibGit2Sharp problems

I am trying to use LibGit2Sharp in Unity 2018.2 beta, because previous versions of Unity doesn't support .NET Framework 4.7.1, which will be needed for LibGit2Sharp.
I wanted to try a few things first and came across the following problems:
if I try to clone a repository (I have used the example on GitHub first: https://github.com/libgit2/libgit2sharp/wiki/git-clone), I get an "LibGit2SharpException: failed to send request" error in Unity.
I have also tried to get information from a working copy. I create a Repository with new Repository(string path), get the RepositoryStatus from it with rep.RetrieveStatus(new StatusOptions()). Now, if I try to access the state of files, it causes a crash in Unity. No matter if I iterate through all files and want to print file.State, or want to get a specific FileStatus list from the whole status (example: status.Added). However, printing the filepaths works.
Fetching does not works either for me, it throws the same exception as the clone command.
I think the second one is maybe just an issue, but clone and fetch should work.
Update: sadly, I keep facing problems in my project with libgit2sharp in Unity. I want to make a commit, now if i try to iterate through the StatusEntries to stage the files, Unity just crashes, but sometimes it works. It is really hard to reproduce the bug, and often I get different crashlog-entries for the same process. The last time I have tried today the error was:
0x00007FFB417386CE (git2-6311e88) [c:\projects\libgit2sharp-nativebinaries\libgit2\src\diff_generate.c:1352] git_diff_tree_to_index
I have created a test-repository in my program using the Github API and cloned this to my pc, this works fine so far. And then if I create some files in the folder and want to make a commit, I run into the error above. Sadly this is one of several other issues and I can't really make progress with my project.
I have installed libgit2sharp and binaries with the Nuget Package Manager of Visual Studio.
Does anyone have experience with LibGit2Sharp and maybe some ideas of what I could be doing wrong, or why these things don't work for me?
Update 2: I'm still trying to solve the problem. I have now tested multiple times the different ways to get informations about the file-status of a repository. The best way to do it in my project would be with Repository.RetrieveStatus(filePath), now if I try this, it throws an AmbiguousSpecificationException. Can somebody explain, what does this exactly mean and how can I avoid it? I have also tried to force a literal path evaluation with Repository.RetrieveStatus(new StatusOptions() { DisablePathSpecMatch = true }); as recommended in the message of the AmbiguousSpecificationException, but then Unity crashes with the error-log in the first Update of this Post.
I had the same problem where Unity crashed on RetrieveStatus(); call. Seems like this might be a bug in LibGit2Sharp since RetrieveStatus("filepath") worked for me. I used the latest libgit2sharp commit (0dcaefc) and Unity 2018.3.0f2.
I used the absolute filepath and "\" instead of "/" (running on Windows 10).

Unity3D is unable to find jar system path after importing google play services library

Iam trying to upload a simple Unity3D test app on my Google Play Games Console. The only purpose of this is to get familiarized with the workings of this as I have just opened up my account and Iam a first timer on the subject.
I have started out with a great tutorial on implementing Google Play Services Library I found on YT. The test app was working okay except for the end part where I had problems with the built. Nevertheless I decided to redo the test app from the begining for better understanding and memorization of the procces and maybe figuring out why the build was not working as it should have been.
Before redoing everyting I upgraded Unity to 5.4.1f1. (from 5.3.3f1)
Now after I import the Google Play Services Library to the project and try to setup the Google Play Games > Setup > Android Setup, Unity is suddenly unable to find jar system path.
When I press play button I get the below error:
Error
I went through the readme file, made sure everything was done as listed (source), read through dozens of questions/answers here and on Unity Community, and I still cannot find a soultion for my problem. I made sure that the paths were correct, checked other projects and they are still working fine. So the problem starts with importation of the GPSL.
Any help would be greatly appreciated !
Solved the problem. I was not paying enough attention to the redame file on Git.
I had a set JDK variable in Users variables but instead in needed to add also JAVA_HOME variable.
Solved
To set the variable you need to go to Computer/Properties/Advanced system settings/Enviroment variables and set it there.
Do not forget to also add a PATH in the Systems variables.
Hope this helps. Cheers!

Unity3D v4.6.9 game doesn't run on iOS8 with xCode7

When we try running the game we see our splash screen and then we are getting the error Thread1:EXC_BAD_ACCESS code=1
at
il2cpp::icalls::mscorlib::System::String::RedirectToCreateString:
It happens before any of our c# code gets executed - before Awake().
It does run properly on iOS9.
We have tried it on Unity4.6.9 and on Unity4.6.9p3.
We have managed to build and run it for iOS8 only from Unity4.6.6 with xCode6.4. But we do need iOS9.
We can't find any references to this issue on the web, any help will be greatly appreciated.
xCode screen shot:
Unity Player Settings
Edited:
We have tried it from Unity5.2.3 too, no luck.
Another factor you should probably know is that before we run into the issue described above, we have edited the 'Run Debug' scheme of our product in xCode and disabled the 'GPU Frame Capture' because we had a different issue that prevented us from running our game on iOS8.
Here is the link we followed.
And here is a screen shot of our original issue:
We are really stuck here, hope you can help.
Are you sure that this Unity project is using the mscorlib.dll assembly from the Unity version of Mono? It looks like it may not be.
The RedirectToCreateString icall should never actually be executed, as the Mono mscorlib assembly used in Unity build strings via a single CreateString method. When this happens it usually means the moscorlib.dll version is out of sync with the IL2CPP runtime.
I'm not sure why this is happening, but it might be worth trying 4.6.9p3 with an empty (or simple) project to note the difference.
Its a replay for Josh Peterson, I could not replay with an image in a comment to his answer.
I was looking for the mscorlib.dll in my project but couldn't find one, so I looked in an old project and did find it. Here is an image of the file system of both projects.
Any way I don't know the origin of the file, I didn't manually played with it.
I have tried now to copy the mscorlib.dll from the old project to the new with no luck.
Any way my company decided to stop this investigation now and jump to the latest Unity 5.
Hope we will have more luck over there.
Thank you again.