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

GELU causes segment fault #1228

Closed
breadbread1984 opened this issue Mar 6, 2020 · 3 comments
Closed

GELU causes segment fault #1228

breadbread1984 opened this issue Mar 6, 2020 · 3 comments

Comments

@breadbread1984
Copy link

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): ubuntu 18.04 LTS
  • TensorFlow version and how it was installed (source or binary): 2.2.0.dev20200304
  • TensorFlow-Addons version and how it was installed (source or binary): 0.9.0.dev202020303
  • Python version: 3.6.7
  • Is GPU used? (yes/no): no

Describe the bug

any call to GELU causes segment fault.

Code to reproduce the issue

#!/usr/bin/python3

import numpy as np;
import tensorflow as tf;
import tensorflow_addons as tfa;

def model():

  inputs = tf.keras.Input(shape = (12,))
  results = tfa.layers.GELU()(inputs);
  return tf.keras.Model(inputs = inputs, outputs = results);

if __name__ == "__main__":

  m = model();
  a = tf.constant(np.random.normal(size = (10, 12,)))
  b = m(a);

Other info / logs

#0 0x00007fff9d6b7318 in tensorflow::AttrSlice::Find(absl::string_view) const ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so.2
#1 0x00007fff9d6b7420 in tensorflow::AttrSlice::Find(absl::string_view, tensorflow::AttrValue const**) const ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so.2
#2 0x00007fff9d6b7ef3 in tensorflow::GetNodeAttr(tensorflow::AttrSlice const&, absl::string_view, bool*) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so.2
#3 0x00007fff81fad7d0 in tensorflow::addons::{lambda(tensorflow::OpKernelConstruction*)#3}::_FUN ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow_addons/custom_ops/activations/_activation_ops.so
#4 0x00007fff9d58ba17 in tensorflow::CreateOpKernel(tensorflow::DeviceType, tensorflow::DeviceBase*, tensorflow::Allocator*, tensorflow::FunctionLibraryRuntime*, tensorflow::ResourceMgr*, std::shared_ptr<tensorflow::NodeProperties const> const&, int, tensorflow::OpKernel**) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so.2
#5 0x00007fff9d79226d in tensorflow::CreateNonCachedKernel(tensorflow::Device*, tensorflow::FunctionLibraryRuntime*, std::shared_ptr<tensorflow::NodeProperties const> const&, int, tensorflow::OpKernel**) () from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so.2
#6 0x00007fff9d7af905 in tensorflow::FunctionLibraryRuntimeImpl::CreateKernel(std::shared_ptr<tensorflow::NodeProperties const> const&, tensorflow::FunctionLibraryRuntime*, tensorflow::OpKernel**) () from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so.2
#7 0x00007fff9d7b0377 in tensorflow::FunctionLibraryRuntimeImpl::CreateKernel(std::shared_ptr<tensorflow::NodeProperties const> const&, tensorflow::OpKernel**) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/../libtensorflow_framework.so.2
#8 0x00007fffa1d3fb5e in tensorflow::KernelAndDeviceOp::Init(tensorflow::NodeDef const&, tensorflow::GraphCollector*) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#9 0x00007fffa1d0cca9 in tensorflow::(anonymous namespace)::EagerLocalExecute(tensorflow::EagerOperation*, tensorflow::TensorHandle**, int*) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#10 0x00007fffa1d10592 in tensorflow::EagerExecute(tensorflow::EagerOperation*, tensorflow::TensorHandle**, int*) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#11 0x00007fffa18d86fb in tensorflow::OperationInterface::Execute(absl::FixedArray<std::unique_ptr<AbstractTensorHandleInterface, std::default_delete >, 18446744073709551615ul, std::allocator<std::unique_ptr<AbstractTensorHandleInterface, std::default_delete > > >, int) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#12 0x00007fffa18c7411 in TFE_Execute () from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#13 0x00007fffa158a471 in TFE_Py_FastPathExecute_C(_object*) () from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#14 0x00007fff9b020e17 in void pybind11::cpp_function::initialize<pybind11_init__pywrap_tfe(pybind11::module&)::{lambda(pybind11::args)#38}, pybind11::object, pybind11::args, pybind11::name, pybind11::scope, pybind11::sibling>(pybind11_init__pywrap_tfe(pybind11::module&)::{lambda(pybind11::args)#38}&&, pybind11::object ()(pybind11::args), pybind11::name const&, pybind11::scope const&, pybind11::sibling const&)::{lambda(pybind11::detail::function_call&)#3}::_FUN(pybind11::detail::function_call) ()
from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tfe.so
#15 0x00007fff9b042b89 in pybind11::cpp_function::dispatcher(_object
, _object*, _object*) () from /home/xieyi/.local/lib/python3.6/site-packages/tensorflow/python/_pywrap_tfe.so
#16 0x000000000050ac25 in ?? ()
#17 0x000000000050c5b9 in _PyEval_EvalFrameDefault ()
#18 0x0000000000508245 in ?? ()
#19 0x000000000050a080 in ?? ()
#20 0x000000000050aa7d in ?? ()
#21 0x000000000050c5b9 in _PyEval_EvalFrameDefault ()
#22 0x0000000000508245 in ?? ()
#23 0x000000000050a080 in ?? ()
#24 0x000000000050aa7d in ?? ()
#25 0x000000000050d390 in _PyEval_EvalFrameDefault ()

@guillaumekln
Copy link
Contributor

Possibly related to #1109.

@gabrieldemarmiesse
Copy link
Member

gabrieldemarmiesse commented Mar 6, 2020

It seems that you're using TF nightly with TF Addons. TF Addons is not compatible with the nightly version of TF. It's only compatible with the stable version (2.1.0). Since the ABI is not the same, maybe that's the cause for the segmentation fault?

@breadbread1984
Copy link
Author

thx for you replies. The stable version of tensorflow works fine with addons.

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

No branches or pull requests

3 participants