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

segmentation fault with tensorflow 0.8.0 and matplotlib #2085

Closed
Daniel451 opened this issue Apr 25, 2016 · 7 comments
Closed

segmentation fault with tensorflow 0.8.0 and matplotlib #2085

Daniel451 opened this issue Apr 25, 2016 · 7 comments

Comments

@Daniel451
Copy link

Daniel451 commented Apr 25, 2016

When I build a simple script:

import tensorflow
import matplotlib.pyplot as plt
import numpy as np

plt.plot(np.arange(100))
plt.show()

I get a segmentation fault with TensorFlow 0.8.0. Tested with both, Matplotlib 1.5.1 and 1.4.3.

When I downgrade TensorFlow to 0.7.1 everything runs fine, with both, Matplotlib 1.5.1 and 1.4.3.

TensorFlow is installed via pip inside a virtual environment. I've not installed it outside of a virtual-env, because I do not want to break anything on my system.

Environment info

Operating System: Manjaro Linux

uname --all
Linux 4.4.6-1-MANJARO #1 SMP PREEMPT Sat Mar 19 06:00:37 CET 2016 x86_64 GNU/Linux

pip freeze
backports.shutil-get-terminal-size==1.0.0
cycler==0.10.0
decorator==4.0.9
funcsigs==1.0.1
ipython==4.2.0
ipython-genutils==0.1.0
louis==2.6.5
matplotlib==1.5.1
mock==2.0.0
netsnmp-python==1.0a1
nose==1.3.7
numpy==1.11.0
packaging==16.6
pathlib2==2.1.0
pbr==1.9.1
pexpect==4.0.1
pickleshare==0.7.2
protobuf==3.0.0b2
ptyprocess==0.5.1
pwquality==1.3.0
pyparsing==2.1.1
python-dateutil==2.5.3
python-libtorrent==1.0.9
python-musicbrainz==0.0.0
pytz==2016.4
simplegeneric==0.8.1
six==1.10.0
team==1.0
tensorflow==0.7.1
traitlets==4.2.1
virtualenv==15.0.0

@yaroslavvb
Copy link
Contributor

What if you switch the order and do

import numpy as np
import tensorflow
import matplotlib.pyplot as plt

Seems related to #2034

@Daniel451
Copy link
Author

import numpy as np
import tensorflow
import matplotlib.pyplot as plt

plt.plot(np.arange(100))
plt.show()

Produces a segmentation fault, too.

Surprisingly:

import numpy as np                                                                                                                                                                                
import matplotlib.pyplot as plt 
import tensorflow

plt.plot(np.arange(100))
plt.show()

runs fine, no issues at all.

What kind of dark magic is this?^^
Does TensorFlow actually need dependencies to be imported before TensorFlow is imported itself?
Why isn't this happening in TensorFlow 0.7.1?

@lizhitwo
Copy link

lizhitwo commented May 2, 2016

Not sure if this is of any help, but I ran into the same apparent problem -- importing tf and matplotlib.pyplot gives a segfault, but for me the import order does not matter. I resolved my issue by installing the tensorflow and matplotlib inside a virtual environment without the --system-site-packages flag (so everything is installed anew).

I am using Archlinux w/ kernel 4.5.0-1.

@Daniel451
Copy link
Author

Mysterious...
Can someone confirm this issue? Does it only happen on some systems?

@yaroslavvb
Copy link
Contributor

Does it still happen at head? (a similar-sounding segfault issue was fixed in be092f4)

@zsxgb
Copy link

zsxgb commented May 22, 2016

I have the same problem. And that's how it is solved.
Before import tensorflow .I import numpy. It have no problem. And Why This???

@girving
Copy link
Contributor

girving commented Jun 7, 2016

Closing as a duplicate of #2034. This is fixed in 0.9.

@girving girving closed this as completed Jun 7, 2016
fsx950223 pushed a commit to fsx950223/tensorflow that referenced this issue Dec 22, 2023
…ib-again

Fix virtualenv in wheel_verification.bats for urllib dependency issue
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

5 participants