Trying to fit a neural network using dataset “trees”:
alberi = keras_model_sequential() %>%
*** layer_dense(units = 5, activation = “sigmoid”, input_shape = c(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 this 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***
Some could help me please? I’m desperate