python


Tensorflow CPU (normal in python interactive shell, but coredump when run script)


I'm trying to learn Tensorflow on Single CPU mode. When I try to run some examples , such as [mnist_softmax.py] it seems that the whole code run correctly and output the expected answer, but shows [Segmentation fault (core dumped)] and generate a 1.7G or even bigger core file in the end.
When I run the same code in python interactive shell, it runs well and won't appear such Segmentation fault.
And my Tensorflow version is ('v1.0.0-65-g4763edf-dirty', '1.0.1')
Change line 61 from sess = tf.InteractiveSession()
to sess = tf.Session()
and rerun it on the command line.
replace from line 61 to 72 with this
with tf.Session() as sess:
tf.global_variables_initializer().run()
# Train
for _ in range(1000):
batch_xs, batch_ys = mnist.train.next_batch(100)
sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys})
# Test trained model
correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
print(sess.run(accuracy, feed_dict={x: mnist.test.images,
y_: mnist.test.labels}))

Related Links

phpMyAdmin equivalent in python?
Most used Python module for video processing?
Efficient method to determine location on a grid(array)
Python exception backtrace tells me where line ends, where does it begin?
Search directory in SVN for files with specific file extension and copy to another folder?
Is it possible for a running python program to overwrite itself?
Ensuring subprocesses are dead on exiting Python program
Send file using POST from a Python script
How to copy a file to a remote server in Python using SCP or SSH?
Change command Method for Tkinter Button in Python
Why do you need explicitly have the “self” argument into a Python method?
What's a good resource for starting to write a programming language, that's not context free? [closed]
Keeping filters in Django Admin
In GTK, how do I make a window unable to be closed?
Python: how can I handle any unhandled exception in an alternative way?
How to roll my own pypi?

Categories

HOME
ssas-2012
checkbox
amazon-swf
nuxeo
google-tag-manager
translation
agile
smartphone
amazon-product-api
search-engine
phaser-framework
adsense
snap.svg
yocto
sequelize.js
structuremap
cartodb
gatsby
flann
line-api
ida
titan
sql-tuning
opera-mini
arraylist
ms-access-2007
device-detection
ios10.3
marathon
google-maps-android-api-2
npm-install
compare-and-swap
datadog
superscript
rowcount
picturebox
stocks
geo
swiftcharts
qtablewidget
phpspreadsheet
large-data
linq-to-entities
android-preferences
constants
paho
resuming-training
bids
openweathermap
range-v3
proof
windows-95
restivejs
onresume
verbose
chessboard.js
slam-algorithm
spatial-query
gradle-release-plugin
hateoas
datasnap
android-snackbar
anti-patterns
risk-analysis
xjc
digits
twitter-rest-api
ticket-system
obfuscar
orientation-changes
inputaccessoryview
kallithea
activity-streams
ultrawingrid
vcl
smartystreets
config-files
windows-update
fileconveyor
cosm
selectonemenu
easygui
cookieless
smooth
recordset
hardware-acceleration
surefire
external-assemblies
filetime
rd

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App