1. 程式人生 > >ValueError: tf.enable_eager_execution must be called at program startup.

ValueError: tf.enable_eager_execution must be called at program startup.

在Juptynotebook裡面執行一下程式碼,出現了這個錯誤:

import tensorflow as tf
tf.enable_eager_execution()
tfe = tf.contrib.eager

解決方法也很簡單,重新執行一下 kernel 就可以了,restart 即可。

相關推薦

ValueError: tf.enable_eager_execution must be called at program startup.

在Juptynotebook裡面執行一下程式碼,出現了這個錯誤: import tensorflow as tf tf.enable_eager_execution() tfe = tf.contri

ValueError: tfe.enable_eager_execution has to be called at program startup錯誤解決辦法

當我們在使用Jupyter除錯eager的時候,很容易出現一個錯誤,看下圖:這個問題在cmd和pycharm裡面未出現過,但是用ipython就會出現,只要多次點選執行就會出錯,個人的理解是因為程式在除錯的狀態下你還一直按執行的話就會導致出錯,因此解決此問題需要點選Kerne

python 報ValueError: Bin labels must be one fewer than the number of bin edges

在對python資料進行離散化分析時,我想把年齡列進行分組,分成'20-35', '35-50', '50-65', '65-80','80-95','95-110'六組,但是執行時報出了錯誤ValueError: Bin labels must be one fewer than the nu

1 TypeError: Index(...) must be called with a collection of some kind, ' ' was passed columns

今天犯了這個錯誤 ,查到的解決方法如下 columns : Index or array-like Column labels to use for resulting frame. Will default to np.arange(n) if no column labels

安卓開發異常rx.exceptions.OnErrorNotImplementedException: Must be called from main thread of fragment host

rx.exceptions.OnErrorNotImplementedException: Must be called from main thread of fragment host 異常提示:

ValueError: fill value must be in categories.

執行下面程式碼時報錯:ValueError: fill value must be in categories import pandas as pd; import numpy as np; df = pd.DataFrame({'a':[1, 2,

異常A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same

在建立webview的另外一個地方呼叫webview載入網頁,出現異常: 11-10 13:40:49.793: W/WebView(3684): java.lang.Throwable: A WebView method was called on thread 'Ja

《機器學習實戰》第8章 ValueError: Masked arrays must be 1-D

《機器學習實戰》第8章 預測數值型資料:迴歸  函式regression1方法中出錯 def regression1():     xArr, yArr = loadDataSet("./ex0.txt")     xMat = mat

Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding cont

這個Android執行時異常,要求requestWindowFeature方法必須在setContentView載入佈局之前呼叫。 導致錯誤的方法呼叫順序: public void onCreate(Bundle savedInstanceState) {

錯誤ValueError: malformed SHA512 hash (checksum must be exactly 86 chars)解決辦法

flask這個報錯多半是ORM建立數據表的時候,密碼列給的長度不足導致的。比如把password_hash = db.Column(db.String(64))改為password_hash = db.Column(db.String(120)然後重新建立表即可。原因:表沒有足夠空間放置加密後的數據,sha5

ValueError: Dimension 1 in both shapes must be equal, but are 8 and 324 for 'Assign_376' (op: 'Assig

使用Mask-RCNN測試細胞資料集的時候,出現了以下錯誤: Loading weights ../../path/to/weights.h5 Traceback (most recent call last): File "/home/ubuntu/anaconda3/envs/tens

Caused by: java.lang.IllegalArgumentException: At least one JPA metamodel must be present!

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nes

Tensorflow報錯:ValueError: Stride must be > 0, but got 0 for '...' with input shapes: [...], [...]

完整錯誤報錯為:ValueError: Stride must be > 0, but got 0 for 'gradients/CON/de_conv8/conv2d_transpose_grad/Conv2D' (op: 'Conv2D') with input shapes: [96,1

Django_部落格專案 註冊使用者引發 ValueError: The given username must be set

部落格專案中 註冊功能在ajax 提交資料時 報錯 ValueError: The given username must be set   鎖定到錯誤點為    判定為是無法獲取到 username 欄位     那先試下到底是為什麼找不到username 吧     u

【TensorFlow】ValueError: Shape must be rank 1 but is rank 0 for ' ’ with input shapes: [].問題

基於TensorFlow訓練mnist資料集出現如下錯誤: 檢測程式碼,發現是偏置設定格式錯誤導致。 1、錯誤程式碼:  # 定義權重和偏置 n_input = 784 n_output = 10 weights = { 'wc1': tf.Variable(

virt-viewer-5.0編譯出現At one least of spice or vnc must be used

條件:先編譯spice-gtk-0.33原始碼. 系統:Fedora25 架構:x64 1 ./configure ;make; make install 2.進入virt-viewer-5.0目錄執行./configure時,出現了了如題的錯誤。 第一種原因是 配置spice時,未

spark-submit 提示錯誤java.lang.IllegalArgumentException: System memory 468189184 must be at least 4.7185

在執行spark-submit時會報錯,是因為記憶體不足導致的,但是配置了driver-memory和executor-memory時都不行,報錯:ERROR SparkContext: Error initializing SparkContext.java.lang.Il

RMAN-06034: at least 1 channel must be allocated to execute this command

下午做過單表恢復, recover table user.table_name until time "to_date('2018-12-21 15:00:00','yyyy-mm-dd hh24:mi:ss')" auxiliary destination '/backup/bak' re

springboot配置多資料來源java.lang.IllegalArgumentException: At least one JPA metamodel must be present!

前言      springboot 專案啟動時遇到問題: At least one JPA metamodel must be present! ,怎麼解決的呢,下面來一起看下。 正文 問題再現

ValueError: Shape must be rank 2 but is rank 0 for 'MatMul_8' (op: 'MatMul') with input shapes: [],

這個報錯多半是因為自己在定義placeholder的時候,沒有指定shape,導致系統預設將X看做為標量,無法做出正確的匹配 X = tf.placeholder(dtype=tf.float32, shape=()  -》 X = tf.placeholder(dtype