Segmentation fault
See original GitHub issueMy config:
Anaconda 2 + tensorflow (no gpu) / Ubuntu 16.04
I assemble sonnet as specified, except I build with following flag:
bazel build --config=opt :install --copt=“-D_GLIBCXX_USE_CXX11_ABI=0”
I use this flag. because otherwise I get following error:
NotFoundError: /home/kovalenko/anaconda2/lib/python2.7/site-packages/sonnet/python/ops/_resampler.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev
Following code causes error Segmentation fault:
import numpy as np
import sonnet as snt
import tensorflow as tf
image = np.ones((1, 100, 100, 3))
image[0, 50, :, :] = 0
image[0, :, 50, :] = 0
shift = np.ones((100, 100, 2))
shift[:, :, 1] = 0
shift = np.expand_dims(shift, 0)
res = snt.resampler(tf.Variable(initial_value=image), tf.Variable(initial_value=shift))
init_op = tf.global_variables_initializer()
sess = tf.Session()
sess.run(init_op)
# following line triggers error
x = res.eval(session=sess)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Segmentation fault - Wikipedia
Segmentation faults are a common class of error in programs written in languages like C that provide low-level memory access and few to...
Read more >c++ - What is a segmentation fault? - Stack Overflow
A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to...
Read more >Identify what's causing segmentation faults (segfaults)
A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core...
Read more >Core Dump (Segmentation fault) in C/C++ - GeeksforGeeks
When a piece of code tries to do read and write operation in a read only location in memory or freed block of...
Read more >What Is a Segmentation Fault in Linux?
A segmentation fault, or segfault, is a memory error in which a program tries to access a memory address that does not exist...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Tutufa glad you got it sorted - As far as I’m aware we’re not specifying versions of GCC anywhere in the Sonnet repository, but depending on what is installed on your system bazel may pick up mismatching versions. We’ll be updating the install instructions soon to try to cover the issues that people have been having, thanks for providing this information.
Yes, it was gcc version mismatch. Do the following:
I used gcc 5.*