Code Monkey home page Code Monkey logo

tensorflow-unreal-examples's Introduction

TensorFlow Unreal Plugin Examples

GitHub release Github All Releases

Example content project for tensorflow-ue4 plugin.

This repository also tracks changes required across all dependencies to make tensorflow work well with UE4.

See issues for current work and bug reports.

Unreal Forum Thread

Setup

  1. (GPU only) Install CUDA and cudNN pre-requisites if you're using compatible GPUs (NVIDIA)
  2. Download latest project release
  3. Download the matching tensorflow plugin release. Choose CPU download (or GPU version if hardware is supported). The matching plugin link is usually found under the project release.
  4. Browse to your extracted project folder
  5. Copy Plugins folder from your plugin download into your Project root.
  6. Launch and wait for tensorflow dependencies to be installed. The tensorflow plugin will auto-resolve any dependencies listed in Plugins/tensorflow-ue4/Content/Scripts/upymodule.json using pip. Note that this step may take a few minutes and depends on your internet connection speed and you will see nothing change in the output log window until the process has completed.

image

  1. Once you see an output similar to the above in your console window, everything should be ready to go, try different examples from e.g. Content/ExampleAssets/Maps!

Note on cloning the repository

If you're not using a release, but instead wish to clone the repository using git. Ensure you follow TensorFlow-ue4 instructions on cloning.

Examples

Mnist recognition

Map is found under Content/ExampleAssets/Maps/Mnist.umap and it should be the default map when the project launches.

mnist spawn samples

Default mnist example script: mnistSpawnSamples.py

On map launch you'll have a basic example ready for play in editor. It should automatically train a really basic network when you hit play and then be ready to use in a few seconds. You can then press 'F' to send e.g. image of a 2 to predict. Press 0-9 numbers on your keyboard to change the input, press F again to send this updated input to classifier. Note that this is a very basic classifier and it will struggle to classify digits above 4 in the current setup.

Classifying custom data

You can change the input to any UTexture2D you can access in your editor or game, but if the example is using a ConnectedTFMnistActor you can also use your mouse/fingers to draw shapes to classify. Simply go to http://qnova.io/e/mnist on your phone or browser after your training is complete, then draw shapes in your browser and it will send those drawn shapes to your UE4 editor for classification.

custom classification

Note that only the latest connected UE4 editor will receive these drawings, if it's not working just restart your play in editor to become the latest editor that connected. You can also host your own server with the node.js server module found under: https://github.com/getnamo/TensorFlow-Unreal-Examples/tree/master/ServerExamples. If you want to connect to your own server, change the ConnectedTFMnistActor->SocketIOClient->Address and Port variable to e.g. localhost:3000.

Other classifiers e.g. CNN Keras model

If you want to try other mnist classifiers models, change your ConnectedTFMnistActor->Python TFModule variable to that python script class. E.g. if you want to try the Keras Convolutional Neural Network Classifier change the module name to mnistKerasCNN and hit play. Note that this classifier may take around 18 min to train on a CPU, or around 45 seconds on a GPU. It should however be much more accurate than the basic softmax classifier used by default.

See available classifier models provided here: https://github.com/getnamo/TensorFlow-Unreal-Examples/tree/master/Content/Scripts

Saving / Loading Models

mnistSaveLoad python script will train on the first run and then save the trained model. Each subsequent run will then use that trained model, skipping training. You can also copy and paste this saved model to a new project and then when used in a compatible script, it will also skip the training. Use this as a guide to link your own pre-trained network for your own use cases.

You can force retraining by either changing ConnectedTFMnistActor->ForceRetrain to true or deleting the model found under Content/Scripts/model/mnistSimple

Basic Tensorflow Example - Addition & Subtraction of Float Arrays

Map is found under Content/ExampleAssets/Maps/Basic.umap

basic example

Uses TFAddExampleActor to encapsulate addExample.py. This is a bare bones basic example to use tensorflow to add or subtract float array data. Press 'F' to send current custom struct data, press 'G' to change operation via custom function call. Change your default ExampleStruct a and b arrays to change the input sent to the tensorflow python script.

Other Examples

If you have other examples you want to implement, consider contributing or post an issue with a suggestion.

Tensorflow API

See https://github.com/getnamo/tensorflow-ue4 for latest documentation.

Dependencies

depends on:

https://github.com/getnamo/tensorflow-ue4

https://github.com/getnamo/UnrealEnginePython

https://github.com/getnamo/socketio-client-ue4

Troubleshooting

Startup Error

If you're seeing something like

no plugins error

You did not follow step 3. in setup. Each release has a matching plugin that you need to download and drag into the project folder.

Video

There's a video made by github user Berranzan that walks through setting up the tensorflow examples for 4.18 with GPU support.

Neural networks on UE4

For issues not covered in the readme see:

https://github.com/getnamo/TensorFlow-Unreal-Examples/issues

and

https://github.com/getnamo/TensorFlow-Unreal/issues

Presentation

Example project used in the presentation https://drive.google.com/open?id=1GiHmYJeZI6BKUKYfel6xc0YFhMbjSOoCY17nl98dihA contained in https://github.com/getnamo/TensorFlow-Unreal-Examples/tree/presentation branch

Second presentation with 0.4 api: https://docs.google.com/presentation/d/1p5p6CjYYYfbflFpvr104U1GwrfArfl4Hkcb6N3SIBH8

tensorflow-unreal-examples's People

Contributors

getnamo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflow-unreal-examples's Issues

Packaging Problem

Hello again,

So, I downloaded the newest version of the tensorflow-ue4-examples and the plugin you have linked (Version 0.9.0). I downloaded Unreal Engine v.4.20.3.
Then I tried to follow these instructions: https://allarsblog.com/2015/11/04/converting-bp-project-to-cpp/
I can build the project in "Developer Editor" mode, but when I am switching to "Developer" mode I get the following building errors:

errors
(I am using Visual Studio 2017, same errors in 2015)

Can you help me with that? Have I done something wrong? Did I forgot to install something?
If I cannot build it, I cannot package it, correct?

Hope you can help me. Thank you in advance!
Best regards
Marcel

LINK : fatal error LNK1181: cannot open input file 'C:\Users\~\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\ThirdParty\Python35\Lib\Python35.lib'

When trying the tensorflow-ue4-examples with 4.14.3, we get the following issue:

LINK : fatal error LNK1181: cannot open input file 'C:\User~\ue4-Tensorflow\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\ThirdParty\Python35\Lib\Python35.lib'

I've tried all variations of the plugin UnrealEnginePython, I even tried to use the embedded Python35.

Can you provide version information?

Thanks and awesome work, as always.

-io

Predictions are not as accurate as they could be

Hey, not sure if I'm doing something wrong here or everyone gets this. With mnistSimple, every prediction after 4 is wrong just using the keyboard. 5 -> 3; 6 -> 5; 7 ->3; 8 -> 3; 9 -> 3. 0 is correct. Also drawing is giving incorrect results. The sample data is successfully downloading and the training completes. The received image comes back correct. I have Test loss:0.04954743304257281 and Test accuracy:0.9837 in the log. If I switch to the kerasCNN it improves but is still broken. Was getting 7 for pressing 9 on the keyboard. Now getting 3 for pressing 9. If i draw the numbers, for 8 I got 3. For 9 I was getting 7 but now it seems to be working.

I am on tf ue4 0.6.0 with cuda 9.0.176.1 and cudnn v7. I should note that I also had this issue on tf ue4 4 or 5 with cuda 8 and cudnn v6. I figured I'd try the examples again when you released an update for 4.18.

Plugin issue for UE4.15.1 release

Hello,
Thanks for posting this, it is amazing! I have gotten this project to work before for python27, but I need python35 for what I'm trying to do. I've been trying to build this project but I have not been able to. I keep getting the following errors:

Any idea why these errors could pop up?
Thanks so much for you time :)

\plugins\unrealenginepython\source\unrealenginepython\private\UEPyFARFilter.h(11): error C2079: '::filter' uses undefined struct 'FARFilter'

\Plugins\socketio-client-ue4\Source\SIOJEditorPlugin\Private\SIOJ_BreakJson.cpp(34): error C2653: 'FEdGraphUtilities': is not a class or namespace name

\Plugins\socketio-client-ue4\Source\SIOJEditorPlugin\Private\SIOJ_BreakJson.cpp(34): error C3861: 'GetNetFromPin': identifier not found

\Plugins\socketio-client-ue4\Source\SIOJEditorPlugin\Private\SIOJ_BreakJson.cpp(121): error C2653: 'FEdGraphUtilities': is not a class or namespace name

\Plugins\socketio-client-ue4\Source\SIOJEditorPlugin\Private\SIOJ_BreakJson.cpp(121): error C3861: 'GetNetFromPin': identifier not found

\Plugins\UnrealEnginePython\Source\PythonConsole\Private\PythonConsoleModule.cpp(75): error C2228: left of '.GetDeveloperToolsLogCategory' must have class/struct/union

Plugins\UnrealEnginePython\Source\PythonConsole\Private\PythonConsoleModule.cpp(76): error C2228: left of '.SetIcon' must have class/struct/union

ERROR : UBT error : Failed to produce item: C:\Users\jelly\Desktop\UE4151release\tensorflow\Plugins\UnrealEnginePython\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-UnrealEnginePython.lib

TensorFlowBlueprintLibrary.cpp(166): error C2039: 'Source': is not a member of 'UTextureRenderTarget2D'

1>D:\UnrealEngine-4.19.2-release\TensorFlowExamples\Plugins\tensorflow-ue4\Source\TensorFlow\Private\TensorFlowBlueprintLibrary.cpp(166): error C2039: 'Source': is not a member of 'UTextureRenderTarget2D'
1>D:\UnrealEngine-4.19.2-release\TensorFlowExamples\Plugins\tensorflow-ue4\Intermediate\Build\Win64\TensorFlowExamples\Inc\TensorFlow\TensorFlowBlueprintLibrary.generated.h(11): note: see declaration of 'UTextureRenderTarget2D'
1>D:\UnrealEngine-4.19.2-release\TensorFlowExamples\Plugins\tensorflow-ue4\Source\TensorFlow\Private\TensorFlowBlueprintLibrary.cpp(166): error C2228: left of '.UnlockMip' must have class/struct/union

how to communicate real time?

I have a question, I've trained a model in TensorFlow.Keras and now my python editor in the Unreal Engined 4.18.3, have all modules I need (i.e TensorFlow and Keras) but in the case of the driving simulator I need communication between python scripts and the Unreal Environment, how can I do that?

Cant Open the Project

I have downloaded the project and put the plugins in the root.When I click the project, I need rebuild the modules(The following modules are missing or built with a different engine version:SocketIOClient,SIOJson,SocketIOLib,CoreUtility,SIOJeditorPlugin,TensorFlow,etc), then I click 'yes', the project is closed(Error: "Project name" could not be compiled.Try rebuilding from source manually).
How can I solve the problem?
thank you very much!

Pong project

Have you managed to create a pong project yet?

Hi - I'm idiot. --> Google Teachable Machine

Hi, I'm an idiot.

Suggestion: Make an example guide of transferring a model from google teachable machine to an example project in unreal. I'm convinced this has to be fairly easy, yet I don't even manage to grasp where to start...
As I said, I'm an idiot but I would really, really like to be able to use pretrained models from the google teachable machine project in unreal. This would make it far easier I think for idiots such as myself to get some use out of this wonderful plugin. I'm currently struggling to make heads or tails of anything regarding this, too stubborn to give up, not too stubborn to ask for help.

First Release

Todo:

  • BP <-> Python Communication
  • successfully import tensorflow in unreal engine
  • Texture conversion to float arrays
  • Proof of Concept
  • Presentation
  • Encapsulate pip site packages and python basic modules in python plugin path
  • Encapsulate tensorflow scripts in plugin path
  • pip from python working
  • automatic pip dependency resolution
  • PoC API: Init, SendTensor-> OnResult
  • Basic log wrapping for print() -> ue.log()
  • basic threading support to make Tensorflow operations non-blocking
  • mainthread callbacks with results
  • verify running multithreaded calls multiple times works with core TF api
  • basic API: Set script, Train, Run & event callbacks: OnInitComplete, OnTrained, OnResult
  • update to TF 1.0.0 for stable API
  • misc bugfixes
  • pull unrealpythonplugin latest master changes
  • update SocketIO to 0.5.2
  • test external drag and drop
  • fix drag and drop problems: pip initialization, uninstall crash
  • fix path inconsistencies (likely relative paths)
  • confirm #6 is fixed
  • confirm #5 is fixed
  • confirm #4 is fixed
  • fix #7
  • fix #8
  • auto-resolve pip if project moved
  • auto-resolve pip if we delete site-packages
  • documentation update
  • second presentation
  • example videos

Current focus: cleanup and fixes

UE5 Supported Example

Please add an example project for UE5.1 if you can. It looks like you have a beta version of the TF UE plugin released, but don't have a sample project for it.

Example Project + Latest Binary Release Not Training

I've downloaded the example project and copied into it the latest release of tensflow for UE4. I've made sure to enable all three plugins and I have no errors at all.

However no training is being done. None of the example projects work.

Compile problem

Hello~

I'm lucky to find you are doing the work I want to do. But I have a problem in install this project.
My environment:
Win 10 + python 3.6 + VS 2015 + UE 4.12.5
I git this project and include the three plugin also.
https://github.com/getnamo/tensorflow-ue4
https://github.com/getnamo/UnrealEnginePython
https://github.com/getnamo/socketio-client-ue4
all are latest and put them in the /plugin/ also.
but have the compile problem in the SocketIOClientComponent.cpp

image

could I solve this problem? I think I maybe lost a step or must change the plugin code?

4.23 Example not working "LogPython: No module named 'TensorFlowComponent'"

I recently upgraded computers and am having trouble getting this working again. I haven't change my specs all that much however this project used to work on my old computer and now it does not on my new one.

When I press play the level starts, doesn't throw any error messages, and lets me press the keyboard to change the numbers displayed. It seems to skip entirely over the training portion and it no longer does anything when I press "F". I noticed I was getting an error message in my output log, however I'm not sure how to correct it. I understand python but am new to Unreal Engine.

Windows 10

Output Log below

LogTemp: Repeating last play command: Selected Viewport
LogBlueprintUserMessages: Early PlayInEditor Detection: Level '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel' has LevelScriptBlueprint '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist' with GeneratedClass '/Game/ExampleAssets/Maps/Mnist.Mnist_C' with ClassGeneratedBy '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist'
LogPlayLevel: PlayLevel: No blueprints needed recompiling
LogHMD: Initializing OVRPlugin session
LogHMD: Allocating Oculus 3296 x 1776 rendertarget swapchain
PIE: New page: PIE session: Mnist (May 12, 2021, 12:51:47 PM)
LogPlayLevel: Creating play world package: /Game/ExampleAssets/Maps/UEDPIE_0_Mnist
LogPlayLevel: PIE: StaticDuplicateObject took: (0.002097s)
LogAIModule: Creating AISystem for world Mnist
LogPlayLevel: PIE: World Init took: (0.000749s)
LogPlayLevel: PIE: Created PIE world by copying editor world from /Game/ExampleAssets/Maps/Mnist.Mnist to /Game/ExampleAssets/Maps/UEDPIE_0_Mnist.Mnist (0.002954s)
LogUObjectHash: Compacting FUObjectHashTables data took 1.17ms
LogInit: XAudio2 using 'Headphones (2- Rift S)' : 2 channels at 48 kHz using 16 bits per sample (channel mask 0x3)
LogInit: FAudioDevice initialized.
LogLoad: Game class is 'GameModeBase'
LogWorld: Bringing World /Game/ExampleAssets/Maps/UEDPIE_0_Mnist.Mnist up for play (max tick rate 0) at 2021.05.12-19.51.48
LogPython: Error: No module named 'TensorFlowComponent'
LogWorld: Bringing up level for play took: 0.001044
LogOnline: OSS: Creating online subsystem instance for: :Context_5
PIE: Play in editor start time for /Game/ExampleAssets/Maps/UEDPIE_0_Mnist 0.469
LogBlueprintUserMessages: Late PlayInEditor Detection: Level '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel' has LevelScriptBlueprint '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist' with GeneratedClass '/Game/ExampleAssets/Maps/Mnist.Mnist_C' with ClassGeneratedBy '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist'
SocketIOLog: SocketIO Connected with session: 0OyiC6LCh3RttJtxABOY
SocketIOLog: SocketIO 0OyiC6LCh3RttJtxABOY connected to namespace: /
LogBlueprintUserMessages: Early EndPlayMap Detection: Level '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel' has LevelScriptBlueprint '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist' with GeneratedClass '/Game/ExampleAssets/Maps/Mnist.Mnist_C' with ClassGeneratedBy '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist'
LogSlate: Updating window title bar state: overlay mode, drag disabled, window buttons hidden, title bar hidden
LogWorld: BeginTearingDown for /Game/ExampleAssets/Maps/UEDPIE_0_Mnist
LogWorld: UWorld::CleanupWorld for Mnist, bSessionEnded=true, bCleanupResources=true
LogPlayLevel: Display: Shutting down PIE online subsystems
LogBlueprintUserMessages: Late EndPlayMap Detection: Level '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel' has LevelScriptBlueprint '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist' with GeneratedClass '/Game/ExampleAssets/Maps/Mnist.Mnist_C' with ClassGeneratedBy '/Game/ExampleAssets/Maps/Mnist.Mnist:PersistentLevel.Mnist'
LogSlate: Updating window title bar state: overlay mode, drag disabled, window buttons hidden, title bar hidden
LogUObjectHash: Compacting FUObjectHashTables data took 1.03ms
LogPlayLevel: Display: Destroying online subsystem :Context_5
LogSlate: Took 0.000133 seconds to synchronously load lazily loaded font '../../../Engine/Content/Slate/Fonts/Roboto-Light.ttf' (167K)

UEPyFSoftSkinVertex.h(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Comes bundled with these other errors,

1>d:\unrealengine-4.19.2-release\tensorflowexamples\plugins\unrealenginepython\source\unrealenginepython\private\Wrappers/UEPyFSoftSkinVertex.h(15): error C3646: 'ss_vertex': unknown override specifier

1>d:\unrealengine-4.19.2-release\tensorflowexamples\plugins\unrealenginepython\source\unrealenginepython\private\Wrappers/UEPyFSoftSkinVertex.h(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\unrealengine-4.19.2-release\tensorflowexamples\plugins\unrealenginepython\source\unrealenginepython\private\Wrappers/UEPyFSoftSkinVertex.h(22): error C2065: 'FSoftSkinVertex': undeclared identifier

Python plugin latent taskgraph crash

If you end play with a latent taskgraph (call back to game thread from python), the plugin will get an invalid object and crash. Will likely need a WorldContext test for scheduled latent tasks.

See:
https://github.com/getnamo/UnrealEnginePython/blob/master/Source/UnrealEnginePython/Private/UEPyEngine.cpp#L468

https://github.com/getnamo/UnrealEnginePython/blob/master/Source/UnrealEnginePython/Private/UEPyLambda.cpp nope this is dormant, using the UEPyEngine function instead atm.

Problem with data_dir

Examples that have line:
self.data_dir = self.scripts_path + '/dataset/mnist'

have to be changed to:
self.data_dir = '/tmp/tensorflow/mnist/input_data'

in order to execute. Not sure if some functionality is affected but examples seem to be working as intended with the change.

Asynchronous Reinforcement Learning

Hi, first of all thanks alot for this plugin, the association TF + UE4 greatly broaden the horizon of what we can do with the engine, and not only in video games.
Lately i was thinking about implementing A3C (https://arxiv.org/abs/1602.01783), thing is, in every implementation they create a scene for each actor-learner (from python) and train each one of them in parallel.
using ue4 + your plugin how would you tacle this problem ?

mnistSaveLoad is not working..

use unreal version : 4.21.2

sample mnistSaveLoad does not work.
When I run the sample, the following error occurs.

Please help me.


sample BeginPlay error

BeginPlay, importing TF module: mnistSaveLoad
Variable W already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\framework\ops.py", line 1717, in init
self._traceback = tf_stack.extract_stack()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\framework\ops.py", line 3155, in create_op
op_def=op_def)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\util\deprecation.py", line 454, in new_func
return func(*args, **kwargs)
Traceback (most recent call last):
File "D:\Unreal\tensorflow-ue4-examples-master\Content\Scripts\mnistSaveLoad.py", line 32, in onSetup
saver = tf.train.import_meta_graph(self.model_path + ".meta")
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\training\saver.py", line 1931, in import_meta_graph
meta_graph_def = meta_graph.read_meta_graph_file(meta_graph_or_file)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\framework\meta_graph.py", line 633, in read_meta_graph_file
raise IOError("File %s does not exist." % filename)
OSError: File ../../../../../../Unreal/tensorflow-ue4-examples-master/Content/Scripts/model/mnistSimple/model.ckpt.meta does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\tensorflow-ue4\Content\Scripts\TensorFlowComponent.py", line 36, in begin_play
self.setup()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\tensorflow-ue4\Content\Scripts\TensorFlowComponent.py", line 56, in setup
self.setup_blocking()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\tensorflow-ue4\Content\Scripts\TensorFlowComponent.py", line 130, in setup_blocking
self.tfapi.onSetup()
File "D:\Unreal\tensorflow-ue4-examples-master\Content\Scripts\mnistSaveLoad.py", line 45, in onSetup
W = tf.get_variable('W', [784, 10], initializer=tf.zeros_initializer)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1467, in get_variable
aggregation=aggregation)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1217, in get_variable
aggregation=aggregation)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\ops\variable_scope.py", line 527, in get_variable
aggregation=aggregation)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\ops\variable_scope.py", line 481, in _true_getter
aggregation=aggregation)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\ops\variable_scope.py", line 848, in _get_single_variable
name, "".join(traceback.format_list(tb))))
ValueError: Variable W already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\framework\ops.py", line 1717, in init
self._traceback = tf_stack.extract_stack()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\framework\ops.py", line 3155, in create_op
op_def=op_def)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\util\deprecation.py", line 454, in new_func
return func(*args, **kwargs)


sample load error

At least two variables have the same name: Adam/beta_1
Traceback (most recent call last):
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\tensorflow-ue4\Content\Scripts\TensorFlowComponent.py", line 36, in begin_play
self.setup()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\tensorflow-ue4\Content\Scripts\TensorFlowComponent.py", line 56, in setup
self.setup_blocking()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\tensorflow-ue4\Content\Scripts\TensorFlowComponent.py", line 130, in setup_blocking
self.tfapi.onSetup()
File "D:\Unreal\tensorflow-ue4-examples-master\Content\Scripts\mnistSaveLoad.py", line 50, in onSetup
self.saver = tf.train.Saver()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\training\saver.py", line 1281, in init
self.build()
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\training\saver.py", line 1293, in build
self._build(self._filename, build_save=True, build_restore=True)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\training\saver.py", line 1330, in _build
build_save=build_save, build_restore=build_restore)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\training\saver.py", line 756, in _build_internal
saveables = self._ValidateAndSliceInputs(names_to_saveables)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\training\saver.py", line 656, in _ValidateAndSliceInputs
names_to_saveables = BaseSaverBuilder.OpListToDict(names_to_saveables)
File "D:\Unreal\tensorflow-ue4-examples-master\Plugins\UnrealEnginePython\Binaries\Win64\Lib\site-packages\tensorflow\python\training\saver.py", line 563, in OpListToDict
name)
ValueError: At least two variables have the same name: Adam/beta_1

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.