Following the code of a neural network based on the dataset “trees”
alberi = keras_model_sequential() %>%
layer_dense(units = 5, activation = “sigmoid”, input_shape = 2) %>%
layer_dense(units = 5, activation = “sigmoid”) %>%
layer_dense(units = 1, activation = “linear”)summary(alberi)
alberi %>% compile(
optimizer = “adam”,
loss = “mse”,
metrics = “accuracy”
)storia = alberi %>% fit(
x = trees[,2:3],
y = trees$Girth,
epochs = 10
)
It returns me the following error:
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: in user code:File "C:\Users\HP\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\keras\engine\training.py", line 1021, in train_function * return step_function(self, iterator) File "C:\Users\HP\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\keras\engine\training.py", line 1010, in step_function ** outputs = model.distribute_strategy.run(run_step, args=(data,)) File "C:\Users\HP\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\keras\engine\training.py", line 1000, in run_step ** outputs = model.train_step(data) File "C:\Users\HP\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\keras\engine\training.py", line 859, in train_step y_pred = self(x, training=True) File "C:\Users\HP\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\HP\AppData\Local\R-MINI~1\
Someone could help me?