Open n4hid opened 3 years ago
Same error on windows as well, could you please let us know
Sorry for pushing this thread but I’m also struggling with this as well. I didn’t know if I should change the output_dims to units instead. If anyone could clarify how we could fix this problem and confusion we would greatly appreciate it.
Ps: I am using windows 10, python 3.8, and Tensorflow 2.
Removing param name output_dim
fixes this:
Replace model.add(Dense(output_dim=self.first_layer, activation='relu', input_dim=11))
with
model.add(Dense(self.first_layer, activation='relu', input_dim=11))
for all instances where Dense layer is created
Removing param name
output_dim
fixes this:
@tipycalFlow hey can you send me a video of this working, whether its a youtube link or something. this would be very helpful.
Sorry for not bringing a solution, but this replaces the error with
Traceback (most recent call last):
File "thonnyfiler/snake/snake-ga-master1/snakeClass.py", line 308, in
Removing param name
output_dim
fixes this: Replacemodel.add(Dense(output_dim=self.first_layer, activation='relu', input_dim=11))
withmodel.add(Dense(self.first_layer, activation='relu', input_dim=11))
for all instances where Dense layer is created
Change these lines to units
instead of output_dim
in DQN.py lines 31-34:
model.add(Dense(units=self.first_layer, activation='relu', input_dim=11)) model.add(Dense(units=self.second_layer, activation='relu')) model.add(Dense(units=self.third_layer, activation='relu')) model.add(Dense(units=3, activation='softmax'))
2020-11-26 23:16:55.536092: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2020-11-26 23:16:55.550165: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fdf6d52e130 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-11-26 23:16:55.550181: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version Traceback (most recent call last): File "/Users/nahidahmed/Desktop/SnakeGame/snakeClass.py", line 309, in
run(args.display, args.speed, params)
File "/Users/nahidahmed/Desktop/SnakeGame/snakeClass.py", line 223, in run
agent = DQNAgent(params)
File "/Users/nahidahmed/Desktop/SnakeGame/DQN.py", line 29, in init
self.model = self.network()
File "/Users/nahidahmed/Desktop/SnakeGame/DQN.py", line 33, in network
model.add(Dense(output_dim=self.first_layer, activation='relu', input_dim=11))
TypeError: init() missing 1 required positional argument: 'units'