나는 ValueError: Tensor("conv2d_1/kernel:0", ...) must be from the same graph as Tensor("IteratorGetNext:0", ...)
으로 실행 중입니다. 나는 Estimator
클래스로 keras 모델을 재사용하려고합니다. 은 tensorflow에서 사용 가능한 그래프 목록이 있습니다
g = tf.Graph() with g.as_default():
import tensorflow as tf
g = tf.Graph()
with g.as_default():
MODEL = get_keras_model(...)
def model_fn(mode, features, labels, params):
logits = MODEL(features)
...
def parser(record):
...
def get_dataset_inp_fn(filenames, epochs=20):
def dataset_input_fn():
dataset = tf.contrib.data.TFRecordDataset(filenames)
dataset = dataset.map(parser)
...
with tf.Session(graph=g) as sess:
est = tf.estimator.Estimator(
model_fn,
model_dir=None,
config=None,
params={"optimizer": "AdamOptimizer",
"opt_params":{}}
)
est.train(get_dataset_inp_fn(["mydata.tfrecords"],epochs=20))
에 최선을 둘러싸는 시도하지만 도움이되지 않습니다.
현재 시점까지 정의 된 모든 그래프를 나열하는 방법이 있습니까?
내가 틀렸을 수도 있지만 아직 Keras와 견적을 섞을 수 있다고 생각하지 않습니다 .. 비슷한 문제를보고 ... – dartdog