Malfomed Graphdef error.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python, tensorflow
- Domain
- devtools, machine-learning
Research direction
Start by running the supplied TensorFlow MNIST script with the listed macOS, Python, TensorBoard, and TensorFlow versions, then inspect the full traceback behind the “Malformed GraphDef” error rather than relying on the screenshot. Trace the failure from the TensorBoard callback used during model.fit; done means the cause and affected behavior are confirmed and the issue has a reproducible resolution.
Written by the indexing model from the issue text.
Description
I create a MLP model as follows but get error.
import tensorflow as tf
from tensorflow.keras.datasets import mnist
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten
from tensorflow.keras.callbacks import TensorBoard
import datetime
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = Sequential([
Flatten(input_shape=(28, 28)),
Dense(128, activation='relu'),
Dense(64, activation='relu'),
Dense(10, activation='softmax')
])
model.compile(
optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy']
)
log_dir = "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = TensorBoard(
log_dir=log_dir,
histogram_freq=1,
write_graph=True,
write_images=True,
update_freq='epoch'
)
try:
model.fit(
x_train, y_train,
epochs=5,
validation_data=(x_test, y_test),
callbacks=[tensorboard_callback],
verbose=1
)
except Exception as e:
print(f"error when train: {str(e)}")
raise
try:
model.save('mnist_mlp_model.keras')
except Exception as e:
print(f"error when save: {str(e)}")
raise
print(model.summary())
My environment info is as follows.
macos 15.5 (24F74)
python 3.9.6
tensorboard 2.19.0
tensorboard-data-server 0.7.2
tensorflow 2.19.0
tensorflow-io-gcs-filesystem 0.37.1
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorflow/tensorboard
-
node_repositories in WORKSPACE missing linux_ppc64le and linux_s390x entries for Node.js 18.20.8 Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
tensorflow/tensorboard#7140 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tensorflow/tensorboard#7153 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
tensorflow/tensorboard#7137 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
tensorflow/tensorboard#7119 ·
-
Issue: TensorBoard wheels on PyPI fail with setuptools >81 due to deprecated pkg_resources removal Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
tensorflow/tensorboard#7107 · 2 comments · 7 reactions ·
All issues in tensorflow/tensorboard
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·