Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'TensorFlowComponent' object has no attribute 'tfapi' #59

Open
AgentArachnid66 opened this issue Oct 25, 2020 · 7 comments
Labels

Comments

@AgentArachnid66
Copy link

So I've built the project using a c++ project and have been using this plugin alongside the LeapMotion Plugin for UE4, both of which for UE4.23. I'm sending the frame data gathered from the leap motion to the python script, which works, but refuses to load it into the script. I gathered this from the callback which is below:

LogPython: JSON test script input passed: {"test":"testValue"}
LogPython: Error: Exception in thread Thread-3489:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\paulb\OneDrive\Documents\GitHub\FinalYearProject\Plugins\UnrealEnginePython\Content\Scripts\upythread.py", line 19, in backgroundAction
    result = action(actionArgs)
  File "C:\Users\paulb\OneDrive\Documents\GitHub\FinalYearProject\Plugins\tensorflow-ue4\Content\Scripts\TensorFlowComponent.py", line 114, in json_input_blocking
    resultJson = self.tfapi.onJsonInput(json.loads(args))
AttributeError: 'TensorFlowComponent' object has no attribute 'tfapi'

Not sure where I'm going wrong and would appreciate any help. Please let me know if there is anything else you need

@getnamo
Copy link
Owner

getnamo commented Oct 26, 2020

Which version of the plugin are you using? and did you download it from https://github.com/getnamo/tensorflow-ue4/releases using a .7z archive (not the source/zip)?

@AgentArachnid66
Copy link
Author

AgentArachnid66 commented Oct 26, 2020

I'm using the release for 4.23 that I downloaded from that link. Also, thank you for the quick reply

@getnamo
Copy link
Owner

getnamo commented Oct 27, 2020

Do the examples https://github.com/getnamo/tensorflow-ue4-examples/releases/tag/0.7.0 (TensorFlowExamples-ue4.23-v0.7.0-noplugins.7z
) with https://github.com/getnamo/tensorflow-ue4/releases/tag/0.14.0 dragged in it (tensorflow-ue4.23-v0.14.0-cpu.7z
) work for you?

@AgentArachnid66
Copy link
Author

AgentArachnid66 commented Nov 4, 2020

No, I just tried it by following the link you posted and then built it. The console just says:

LogPython: Error: No module named 'TensorFlowComponent'

Sorry for the late reply, I've been unexpectedly busy recently

@getnamo
Copy link
Owner

getnamo commented Nov 4, 2020

You shouldn't need to build it if you follow the above instructions, the .7z has the embedded python included, I suspect it's using your machine python instead of the locally embedded python that has links setup for the TensorFlowComponent or you're trying to use the master branch with 4.23, which is for 4.25 and with a very different setup expectation (locally networked). NB branch compatible with 4.23 is https://github.com/getnamo/tensorflow-ue4/tree/0.14.0

@AgentArachnid66
Copy link
Author

So I just spent the past few hours trying to get it to work. I can't seem to get it to work with the examples. I put in the right module and class names into the tensorflow component and it gives me:

LogPython: Error: No module named 'tensorflow' LogPython: Error: Traceback (most recent call last): LogPython: Error: File "TensorFlowExamples-ue4.23-v0.7.0-noplugins\tensorflow-ue4-examples\Content\Scripts\mnistSimple.py", line 5, in <module> from tensorflow.examples.tutorials.mnist import input_data LogPython: Error: ModuleNotFoundError: No module named 'tensorflow'

@getnamo
Copy link
Owner

getnamo commented Nov 29, 2020

That indicates the tensorflow module isn't installed, try manually installing the pop package in your site packages (inside unreal engine python plugin > binaries)

Normally that gets automatically installed on startup though (see quick setup section of readme)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants