TypeError: __init__() got an unexpected keyword argument 'Log_dir'












1












$begingroup$


I am trying to build model to convert Sign Language to text. I am facing some problem while trying to create and using tensorboard object inorder to visually see the output and optimize my model.



from tensorflow.keras.layers import Dense, Activation, Conv2D, Flatten, MaxPooling2D,Dropout
from tensorflow.keras.models import Sequential
from tensorflow.keras.utils import normalize
from tensorflow.keras.callbacks import TensorBoard
import numpy as np
import tensorflow as tf
import pickle
import cv2
import time
# Load the dataset

X = pickle.load(open("X_ab.pickle", "rb"))
Y = pickle.load(open("Y_ab.pickle", "rb"))

modelname = "a-z{}".format(int(time.time()))
board = TensorBoard(Log_dir="logs/{}".format(modelname))

# Scaling the data. /255 since data is image data
X = normalize(X, axis=1)
print("({})".format(X.shape[0]/2400)+str(X.shape)) # (2400,50,50,1) - n,y,x,c


model = Sequential()
model.add(Conv2D(64, (3, 3), input_shape=X.shape[1:])) # 64 3,3
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2))) #
model.add(Dropout(0.40))
model.add(Conv2D(128, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))

# EXTRA
model.add(Conv2D(64, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))



# remember to flatten the data since the data is 2d and dense accepts 1d data
model.add(Flatten())
#model.add(Dense(128)) # 64 to 32

model.add(Dense(26)) # OG 1
model.add(Activation('sigmoid')) # sigmoid


model.compile(loss='sparse_categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'])

# batch size should be kept a little low(20-200) to avoid negative results

model.fit(X, Y, batch_size=30, epochs=10, validation_split=0.2,callbacks = [board]) # OG 30
model.save("modelname")


i = 6
while i <= 10:
model.fit(X, Y, batch_size=30, epochs=i, validation_split=0.2,callbacks = [board]) # OG 30
model.save("{} - ({}).model".format(modelname,i))
i = i+1


The error which I am getting is as follow:



python3 model_a-z.py
Traceback (most recent call last):
File "model_a-z.py", line 16, in <module>
board = TensorBoard(Log_dir="logs/{}".format(modelname))
TypeError: __init__() got an unexpected keyword argument 'Log_dir'









share|improve this question









$endgroup$












  • $begingroup$
    I've already tried reinstallin protobuf(current version 3.6) tensorflow 1.12.0, tensorboard 12.2.2 and python 3.6
    $endgroup$
    – huzefa Ratlamwala
    yesterday








  • 1




    $begingroup$
    Keras/TensorBoard is looking for "log_dir" rather than "Log_dir", isn't it?
    $endgroup$
    – redhqs
    yesterday
















1












$begingroup$


I am trying to build model to convert Sign Language to text. I am facing some problem while trying to create and using tensorboard object inorder to visually see the output and optimize my model.



from tensorflow.keras.layers import Dense, Activation, Conv2D, Flatten, MaxPooling2D,Dropout
from tensorflow.keras.models import Sequential
from tensorflow.keras.utils import normalize
from tensorflow.keras.callbacks import TensorBoard
import numpy as np
import tensorflow as tf
import pickle
import cv2
import time
# Load the dataset

X = pickle.load(open("X_ab.pickle", "rb"))
Y = pickle.load(open("Y_ab.pickle", "rb"))

modelname = "a-z{}".format(int(time.time()))
board = TensorBoard(Log_dir="logs/{}".format(modelname))

# Scaling the data. /255 since data is image data
X = normalize(X, axis=1)
print("({})".format(X.shape[0]/2400)+str(X.shape)) # (2400,50,50,1) - n,y,x,c


model = Sequential()
model.add(Conv2D(64, (3, 3), input_shape=X.shape[1:])) # 64 3,3
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2))) #
model.add(Dropout(0.40))
model.add(Conv2D(128, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))

# EXTRA
model.add(Conv2D(64, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))



# remember to flatten the data since the data is 2d and dense accepts 1d data
model.add(Flatten())
#model.add(Dense(128)) # 64 to 32

model.add(Dense(26)) # OG 1
model.add(Activation('sigmoid')) # sigmoid


model.compile(loss='sparse_categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'])

# batch size should be kept a little low(20-200) to avoid negative results

model.fit(X, Y, batch_size=30, epochs=10, validation_split=0.2,callbacks = [board]) # OG 30
model.save("modelname")


i = 6
while i <= 10:
model.fit(X, Y, batch_size=30, epochs=i, validation_split=0.2,callbacks = [board]) # OG 30
model.save("{} - ({}).model".format(modelname,i))
i = i+1


The error which I am getting is as follow:



python3 model_a-z.py
Traceback (most recent call last):
File "model_a-z.py", line 16, in <module>
board = TensorBoard(Log_dir="logs/{}".format(modelname))
TypeError: __init__() got an unexpected keyword argument 'Log_dir'









share|improve this question









$endgroup$












  • $begingroup$
    I've already tried reinstallin protobuf(current version 3.6) tensorflow 1.12.0, tensorboard 12.2.2 and python 3.6
    $endgroup$
    – huzefa Ratlamwala
    yesterday








  • 1




    $begingroup$
    Keras/TensorBoard is looking for "log_dir" rather than "Log_dir", isn't it?
    $endgroup$
    – redhqs
    yesterday














1












1








1





$begingroup$


I am trying to build model to convert Sign Language to text. I am facing some problem while trying to create and using tensorboard object inorder to visually see the output and optimize my model.



from tensorflow.keras.layers import Dense, Activation, Conv2D, Flatten, MaxPooling2D,Dropout
from tensorflow.keras.models import Sequential
from tensorflow.keras.utils import normalize
from tensorflow.keras.callbacks import TensorBoard
import numpy as np
import tensorflow as tf
import pickle
import cv2
import time
# Load the dataset

X = pickle.load(open("X_ab.pickle", "rb"))
Y = pickle.load(open("Y_ab.pickle", "rb"))

modelname = "a-z{}".format(int(time.time()))
board = TensorBoard(Log_dir="logs/{}".format(modelname))

# Scaling the data. /255 since data is image data
X = normalize(X, axis=1)
print("({})".format(X.shape[0]/2400)+str(X.shape)) # (2400,50,50,1) - n,y,x,c


model = Sequential()
model.add(Conv2D(64, (3, 3), input_shape=X.shape[1:])) # 64 3,3
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2))) #
model.add(Dropout(0.40))
model.add(Conv2D(128, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))

# EXTRA
model.add(Conv2D(64, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))



# remember to flatten the data since the data is 2d and dense accepts 1d data
model.add(Flatten())
#model.add(Dense(128)) # 64 to 32

model.add(Dense(26)) # OG 1
model.add(Activation('sigmoid')) # sigmoid


model.compile(loss='sparse_categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'])

# batch size should be kept a little low(20-200) to avoid negative results

model.fit(X, Y, batch_size=30, epochs=10, validation_split=0.2,callbacks = [board]) # OG 30
model.save("modelname")


i = 6
while i <= 10:
model.fit(X, Y, batch_size=30, epochs=i, validation_split=0.2,callbacks = [board]) # OG 30
model.save("{} - ({}).model".format(modelname,i))
i = i+1


The error which I am getting is as follow:



python3 model_a-z.py
Traceback (most recent call last):
File "model_a-z.py", line 16, in <module>
board = TensorBoard(Log_dir="logs/{}".format(modelname))
TypeError: __init__() got an unexpected keyword argument 'Log_dir'









share|improve this question









$endgroup$




I am trying to build model to convert Sign Language to text. I am facing some problem while trying to create and using tensorboard object inorder to visually see the output and optimize my model.



from tensorflow.keras.layers import Dense, Activation, Conv2D, Flatten, MaxPooling2D,Dropout
from tensorflow.keras.models import Sequential
from tensorflow.keras.utils import normalize
from tensorflow.keras.callbacks import TensorBoard
import numpy as np
import tensorflow as tf
import pickle
import cv2
import time
# Load the dataset

X = pickle.load(open("X_ab.pickle", "rb"))
Y = pickle.load(open("Y_ab.pickle", "rb"))

modelname = "a-z{}".format(int(time.time()))
board = TensorBoard(Log_dir="logs/{}".format(modelname))

# Scaling the data. /255 since data is image data
X = normalize(X, axis=1)
print("({})".format(X.shape[0]/2400)+str(X.shape)) # (2400,50,50,1) - n,y,x,c


model = Sequential()
model.add(Conv2D(64, (3, 3), input_shape=X.shape[1:])) # 64 3,3
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2))) #
model.add(Dropout(0.40))
model.add(Conv2D(128, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Dropout(0.25))

# EXTRA
model.add(Conv2D(64, (3, 3))) # 5,5
model.add(Activation('relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))



# remember to flatten the data since the data is 2d and dense accepts 1d data
model.add(Flatten())
#model.add(Dense(128)) # 64 to 32

model.add(Dense(26)) # OG 1
model.add(Activation('sigmoid')) # sigmoid


model.compile(loss='sparse_categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'])

# batch size should be kept a little low(20-200) to avoid negative results

model.fit(X, Y, batch_size=30, epochs=10, validation_split=0.2,callbacks = [board]) # OG 30
model.save("modelname")


i = 6
while i <= 10:
model.fit(X, Y, batch_size=30, epochs=i, validation_split=0.2,callbacks = [board]) # OG 30
model.save("{} - ({}).model".format(modelname,i))
i = i+1


The error which I am getting is as follow:



python3 model_a-z.py
Traceback (most recent call last):
File "model_a-z.py", line 16, in <module>
board = TensorBoard(Log_dir="logs/{}".format(modelname))
TypeError: __init__() got an unexpected keyword argument 'Log_dir'






machine-learning deep-learning keras tensorflow machine-learning-model






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









huzefa Ratlamwalahuzefa Ratlamwala

182




182












  • $begingroup$
    I've already tried reinstallin protobuf(current version 3.6) tensorflow 1.12.0, tensorboard 12.2.2 and python 3.6
    $endgroup$
    – huzefa Ratlamwala
    yesterday








  • 1




    $begingroup$
    Keras/TensorBoard is looking for "log_dir" rather than "Log_dir", isn't it?
    $endgroup$
    – redhqs
    yesterday


















  • $begingroup$
    I've already tried reinstallin protobuf(current version 3.6) tensorflow 1.12.0, tensorboard 12.2.2 and python 3.6
    $endgroup$
    – huzefa Ratlamwala
    yesterday








  • 1




    $begingroup$
    Keras/TensorBoard is looking for "log_dir" rather than "Log_dir", isn't it?
    $endgroup$
    – redhqs
    yesterday
















$begingroup$
I've already tried reinstallin protobuf(current version 3.6) tensorflow 1.12.0, tensorboard 12.2.2 and python 3.6
$endgroup$
– huzefa Ratlamwala
yesterday






$begingroup$
I've already tried reinstallin protobuf(current version 3.6) tensorflow 1.12.0, tensorboard 12.2.2 and python 3.6
$endgroup$
– huzefa Ratlamwala
yesterday






1




1




$begingroup$
Keras/TensorBoard is looking for "log_dir" rather than "Log_dir", isn't it?
$endgroup$
– redhqs
yesterday




$begingroup$
Keras/TensorBoard is looking for "log_dir" rather than "Log_dir", isn't it?
$endgroup$
– redhqs
yesterday










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "557"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46047%2ftypeerror-init-got-an-unexpected-keyword-argument-log-dir%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Data Science Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46047%2ftypeerror-init-got-an-unexpected-keyword-argument-log-dir%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to label and detect the document text images

Vallis Paradisi

Tabula Rosettana