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

error: cannot initialize a member subobject of type 'ternaryfunc' (aka '_object *(*)(_object *, _object *, _object *)') with an lvalue of type 'PyObject *(PyObject *)' (aka '_object *(_object *)'): different number of parameters (3 vs 1) #46587

Closed
dbl001 opened this issue Jan 21, 2021 · 5 comments
Assignees
Labels
subtype:macOS macOS Build/Installation issues type:build/install Build and install issues

Comments

@dbl001
Copy link

dbl001 commented Jan 21, 2021

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • OS X 10.15.7 - Catalina
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed from (source or binary):
  • source
  • TensorFlow version:
  • Master
  • Python version:
  • Anaconda 3.6
  • Installed using virtualenv? pip? conda?:
  • Conda
  • Bazel version (if compiling from source):
  • bazelisk
  • GCC/Compiler version (if compiling from source):
  • Apple clang version 12.0.0 (clang-1200.0.32.28)
  • CUDA/cuDNN version:
  • GPU model and memory:
  • CPU

Describe the problem

ERROR: /Users/davidlaxer/tensorflow/tensorflow/python/lib/core/BUILD:49:11: C++ compilation of rule '//tensorflow/python/lib/core:bfloat16_lib' failed (Exit 1): wrapped_clang failed: error executing command external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 63 argument(s) skipped)
tensorflow/python/lib/core/bfloat16.cc:219:5: error: cannot initialize a member subobject of type 'ternaryfunc' (aka '_object ()(_object *, _object *, _object *)') with an lvalue of type 'PyObject *(PyObject *)' (aka '_object *(_object *)'): different number of parameters (3 vs 1)
PyBfloat16_Negative, // nb_negative
^~~~~~~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:229:5: error: cannot initialize a member subobject of type 'binaryfunc' (aka '_object ()(_object *, _object *)') with an lvalue of type 'PyObject *(PyObject *)' (aka '_object *(_object )'): different number of parameters (2 vs 1)
PyBfloat16_Int, // nb_int
^~~~~~~~~~~~~~
tensorflow/python/lib/core/bfloat16.cc:333:1: error: unknown type name 'Py_hash_t'; did you mean 'npy_hash_t'?
Py_hash_t PyBfloat16_Hash(PyObject
self) {
^~~~~~~~~
npy_hash_t
bazel-out/darwin-opt/bin/external/local_config_python/numpy_include/numpy/npy_common.h:357:14: note: 'npy_hash_t' declared here
typedef long npy_hash_t;
^
3 errors generated.
Provide the exact sequence of commands / steps that you executed before running into the problem
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

@dbl001 dbl001 added the type:build/install Build and install issues label Jan 21, 2021
@amahendrakar
Copy link
Contributor

@dbl001,
Please make sure you have followed all the instructions as per the build and install guide.

Also, check if you have all the required dependencies listed in the tested build configurations.

Version Python version Compiler Build tools
tensorflow-2.4.0 3.6-3.8 Clang from xcode 10.3 Bazel 3.1.0
tensorflow-2.3.0 3.5-3.8 Clang from xcode 10.1 Bazel 3.1.0
tensorflow-2.2.0 3.5-3.8 Clang from xcode 10.1 Bazel 2.0.0

Thanks!

@amahendrakar amahendrakar added stat:awaiting response Status - Awaiting response from author subtype:macOS macOS Build/Installation issues labels Jan 22, 2021
@dbl001
Copy link
Author

dbl001 commented Jan 22, 2021 via email

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Jan 24, 2021
@dbl001
Copy link
Author

dbl001 commented Jan 24, 2021 via email

@dbl001
Copy link
Author

dbl001 commented Jan 26, 2021

Tensorflow 2.4.1 built successfully with Xcode 10.1 NOT 10.3.

In [1]: import tensorflow
In [2]: print(tensorflow.version)
2.4.1
$ xcode-select -p
/Applications/Xcode 10.1.app/Contents/Developer

@dbl001 dbl001 closed this as completed Jan 26, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subtype:macOS macOS Build/Installation issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants