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

some tensorflow function not work #862

Closed
zhulunwu opened this issue Nov 13, 2020 · 0 comments
Closed

some tensorflow function not work #862

zhulunwu opened this issue Nov 13, 2020 · 0 comments

Comments

@zhulunwu
Copy link

Environment: win 10 , julia 1.5.1 , tensorflow 2.3
following code not work

using PyCall
tf=pyimport("tensorflow")
f(x,y)=x+y
tf.function(f)

ERROR: PyError ($(Expr(:escape, :(ccall(#= C:\Program Files\Julia\local\share\julia\packages\PyCall\BcTLp\src\pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'TypeError'>
TypeError('unsupported callable')
File "C:\Program Files\Julia\local\Python38\lib\site-packages\tensorflow\python\eager\def_function.py", line 1443, in function
return decorated(func)
File "C:\Program Files\Julia\local\Python38\lib\site-packages\tensorflow\python\eager\def_function.py", line 1431, in decorated
decorator_func=Function(
File "C:\Program Files\Julia\local\Python38\lib\site-packages\tensorflow\python\eager\def_function.py", line 521, in init
self._function_spec = function_lib.FunctionSpec.from_function_and_signature(
File "C:\Program Files\Julia\local\Python38\lib\site-packages\tensorflow\python\eager\function.py", line 2313, in from_function_and_signature
fullargspec = tf_inspect.getfullargspec(python_function)
File "C:\Program Files\Julia\local\Python38\lib\site-packages\tensorflow\python\util\tf_inspect.py", line 257, in getfullargspec
return _getfullargspec(target)
File "C:\Program Files\Julia\local\Python38\lib\inspect.py", line 1132, in getfullargspec
raise TypeError('unsupported callable') from ex

Stacktrace:
[1] pyerr_check at C:\Program Files\Julia\local\share\julia\packages\PyCall\BcTLp\src\exception.jl:62 [inlined]
[2] pyerr_check at C:\Program Files\Julia\local\share\julia\packages\PyCall\BcTLp\src\exception.jl:66 [inlined]
[3] _handle_error(::String) at C:\Program Files\Julia\local\share\julia\packages\PyCall\BcTLp\src\exception.jl:83

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

No branches or pull requests

1 participant