Giter VIP home page Giter VIP logo

game-bot's Introduction

Game Bot

By Arda Mavi

Artificial intelligence that learns to play any game by watching you.

How does this work?

  • First: Run program and play any game for a little bit.
  • Second: Run program and watch the artificial intelligence play the game.

How does it work behind the scenes?

When you run the training program, the program listens for your keyboard and mouse moving, then it saves those movements.
Artificial intelligence learn: When I push any button?
And when you run the program, it plays the game just like you!

But how does it learn?

Magic! (just joking)

With deep learning.
Deep Learning is a subfield of machine learning with neural networks inspired by the structure of the brains artificial neural networks.

Playing with Artificial Intelligence:

  1. Open your desired game (If you have already trained the artificial intelligence).
  2. Run python3 ai.py command in terminal.

Creating Training Dataset:

  1. Run python3 create_dataset.py command in terminal.
  2. Play your desired game.
  3. Stop create_dataset program with Cntrl-C in terminal.

Model Training:

python3 train.py

Using TensorBoard:

tensorboard --logdir=Data/Checkpoints/logs

Important Notes:

  • Tested in Python version 3.6.0

  • Install necessary modules with sudo pip3 install -r requirements.txt command.

WINDOWS Installation:

This project is still being worked on ...

game-bot's People

Contributors

a-charvin avatar ardamavi avatar whodiduexpect avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

game-bot's Issues

Code broken/Requires update.

The code is broken and requires considerable upgrades,
'create_dataset.py' Stops execution after displaying 'Using TensorFlow backend.' and nothing happens, No screen shot taking events, No mouse or keyboard recording aspects either.

I can't train or run Ai.py and train.py and i don't know why

here is full cmd console:(myenv) D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master>python train.py
2023-09-02 21:14:03.328755: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2023-09-02 21:14:03.329056: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
42
2023-09-02 21:14:35.033055: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2023-09-02 21:14:35.299533: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1050 Ti computeCapability: 6.1
coreClock: 1.62GHz coreCount: 6 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 104.43GiB/s
2023-09-02 21:14:35.300724: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2023-09-02 21:14:35.301829: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
2023-09-02 21:14:35.304294: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2023-09-02 21:14:37.799763: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2023-09-02 21:14:37.800590: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2023-09-02 21:14:37.801299: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
2023-09-02 21:14:37.801998: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2023-09-02 21:14:37.802189: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2023-09-02 21:14:37.870587: 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
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-09-02 21:14:38.273215: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1636585ccf0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2023-09-02 21:14:38.273462: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2023-09-02 21:14:38.304789: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2023-09-02 21:14:38.305109: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
2023-09-02 21:14:39.500867: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
2023-09-02 21:14:40.800802: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
2023-09-02 21:14:41.233407: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
WARNING:tensorflow:period argument is deprecated. Please use save_freq to specify the frequency in number of batches seen.
2023-09-02 21:14:57.285617: I tensorflow/core/profiler/lib/profiler_session.cc:164] Profiler session started.
2023-09-02 21:14:57.356512: I tensorflow/core/profiler/internal/gpu/cupti_tracer.cc:1391] Profiler found 1 GPUs
2023-09-02 21:14:57.545541: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cupti64_101.dll'; dlerror: cupti64_101.dll not found
2023-09-02 21:14:57.547481: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cupti.dll'; dlerror: cupti.dll not found
2023-09-02 21:14:57.547789: E tensorflow/core/profiler/internal/gpu/cupti_tracer.cc:1441] function cupti_interface_->Subscribe( &subscriber_, (CUpti_CallbackFunc)ApiCallback, this)failed with error CUPTI could not be loaded or symbol could not be found.
Epoch 1/15
Traceback (most recent call last):
File "train.py", line 60, in
main()
File "train.py", line 54, in main
model = train_model(model, x, x_test, x, x_test)
File "train.py", line 41, in train_model
callbacks=checkpoints)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\engine\training.py", line 108, in _method_wrapper
return method(self, *args, **kwargs)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1098, in fit
tmp_logs = train_function(iterator)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\eager\def_function.py", line 780, in call
result = self._call(*args, **kwds)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\eager\def_function.py", line 823, in _call
self._initialize(args, kwds, add_initializers_to=initializers)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\eager\def_function.py", line 697, in _initialize
*args, **kwds))
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\eager\function.py", line 2855, in _get_concrete_function_internal_garbage_collected
graph_function, _, _ = self._maybe_define_function(args, kwargs)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\eager\function.py", line 3213, in _maybe_define_function
graph_function = self._create_graph_function(args, kwargs)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\eager\function.py", line 3075, in _create_graph_function
capture_by_value=self._capture_by_value),
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\framework\func_graph.py", line 986, in func_graph_from_py_func
func_outputs = python_func(*func_args, **func_kwargs)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\eager\def_function.py", line 600, in wrapped_fn
return weak_wrapped_fn().wrapped(*args, **kwds)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\framework\func_graph.py", line 973, in wrapper
raise e.ag_error_metadata.to_exception(e)
ValueError: in user code:

D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\engine\training.py:806 train_function  *
    return step_function(self, iterator)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\engine\training.py:796 step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:1211 run
    return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:2585 call_for_each_replica
    return self._call_for_each_replica(fn, args, kwargs)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:2945 _call_for_each_replica
    return fn(*args, **kwargs)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\engine\training.py:789 run_step  **
    outputs = model.train_step(data)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\engine\training.py:749 train_step
    y, y_pred, sample_weight, regularization_losses=self.losses)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\engine\compile_utils.py:204 __call__
    loss_value = loss_obj(y_t, y_p, sample_weight=sw)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\losses.py:149 __call__
    losses = ag_call(y_true, y_pred)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\losses.py:253 call  **
    return ag_fn(y_true, y_pred, **self._fn_kwargs)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\util\dispatch.py:201 wrapper
    return target(*args, **kwargs)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\losses.py:1605 binary_crossentropy
    K.binary_crossentropy(y_true, y_pred, from_logits=from_logits), axis=-1)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\util\dispatch.py:201 wrapper
    return target(*args, **kwargs)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\keras\backend.py:4823 binary_crossentropy
    return nn.sigmoid_cross_entropy_with_logits(labels=target, logits=output)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\util\dispatch.py:201 wrapper
    return target(*args, **kwargs)
D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\myenv\lib\site-packages\tensorflow\python\ops\nn_impl.py:174 sigmoid_cross_entropy_with_logits
    (logits.get_shape(), labels.get_shape()))

ValueError: logits and labels must have the same shape ((32, 42) vs (32, 150, 150, 3))

(myenv) D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master>python get_model.py
2023-09-02 21:17:29.460608: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2023-09-02 21:17:29.460774: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-09-02 21:17:46.702849: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2023-09-02 21:17:46.803251: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1050 Ti computeCapability: 6.1
coreClock: 1.62GHz coreCount: 6 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 104.43GiB/s
2023-09-02 21:17:46.804015: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2023-09-02 21:17:46.804657: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
2023-09-02 21:17:46.805335: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2023-09-02 21:17:46.809096: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2023-09-02 21:17:46.809872: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2023-09-02 21:17:46.810498: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
2023-09-02 21:17:46.810963: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2023-09-02 21:17:46.811057: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2023-09-02 21:17:46.811913: 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
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-09-02 21:17:46.957368: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x13f47cfed80 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2023-09-02 21:17:46.957585: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2023-09-02 21:17:46.958559: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2023-09-02 21:17:46.958723: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
2023-09-02 21:17:47.116883: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
2023-09-02 21:17:47.924915: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
2023-09-02 21:17:48.095347: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
Model and weights saved

(myenv) D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master>python ai.py
2023-09-02 21:19:39.263161: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2023-09-02 21:19:39.263504: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-09-02 21:19:42.428778: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library nvcuda.dll
2023-09-02 21:19:42.451067: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1716] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1050 Ti computeCapability: 6.1
coreClock: 1.62GHz coreCount: 6 deviceMemorySize: 4.00GiB deviceMemoryBandwidth: 104.43GiB/s
2023-09-02 21:19:42.451726: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2023-09-02 21:19:42.452415: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
2023-09-02 21:19:42.453080: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2023-09-02 21:19:42.455131: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library curand64_10.dll
2023-09-02 21:19:42.457510: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
2023-09-02 21:19:42.458771: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
2023-09-02 21:19:42.459505: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
2023-09-02 21:19:42.459641: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1753] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2023-09-02 21:19:42.460399: 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
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-09-02 21:19:42.474345: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x1cb9e7c65f0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2023-09-02 21:19:42.474536: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2023-09-02 21:19:42.475270: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1257] Device interconnect StreamExecutor with strength 1 edge matrix:
2023-09-02 21:19:42.475704: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1263]
2023-09-02 21:19:42.516371: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
2023-09-02 21:19:43.473269: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
2023-09-02 21:19:43.674724: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 642252800 exceeds 10% of free system memory.
AI starting now!
Traceback (most recent call last):
File "ai.py", line 83, in
main()
File "ai.py", line 45, in main
y_ai = predict(model, screen)
File "D:\downloads\Game-Bot NIGUS MOD\Game-Bot-1-master\predict.py", line 17, in predict
x = X(Image.fromarray(X).resize((size[0] * 4, size[1] * 4),
TypeError: 'function' object is not subscriptable

some keys wont work

i have finnaly got some keys to work, as you can see, a-z works and 1-0 but ctrl or space or those wont work.
that results in when i want to stop create_dataset (ctrl+C) i just get an error and it freezes..
any help please?

Using TensorFlow backend.
Using TensorFlow backend.
Key Pressed:a
Key Pressed:a
Key Pressed:b
Key Pressed:b
Key Pressed:c
Key Pressed:c
Key Pressed:d
Key Pressed:d
Key Pressed:e
Key Pressed:e
Key Pressed:f
Key Pressed:f
Key Pressed:g
Key Pressed:g
Key Pressed:h
Key Pressed:h
Key Pressed:i
Key Pressed:i
Key Pressed:j
Key Pressed:j
Key Pressed:k
Key Pressed:k
Key Pressed:l
Key Pressed:l
Key Pressed:m
Key Pressed:m
Key Pressed:n
Key Pressed:n
Key Pressed:o
Key Pressed:o
Key Pressed:p
Key Pressed:p
Key Pressed:q
Key Pressed:q
Key Pressed:r
Key Pressed:r
Key Pressed:s
Key Pressed:s
Key Pressed:t
Key Pressed:t
Key Pressed:u
Key Pressed:u
Key Pressed:v
Key Pressed:v
Key Pressed:w
Key Pressed:w
Key Pressed:x
Key Pressed:x
Key Pressed:y
Key Pressed:y
Key Pressed:z
Key Pressed:z
Key Pressed:1
Key Pressed:1
Key Pressed:2
Key Pressed:2
Key Pressed:3
Key Pressed:3
Key Pressed:4
Key Pressed:4
Key Pressed:5
Key Pressed:5
Key Pressed:6
Key Pressed:6
Key Pressed:7
Key Pressed:7
Key Pressed:8
Key Pressed:8
Key Pressed:9
Key Pressed:9
Key Pressed:0
Key Pressed:0
Key Pressed:+
Key Pressed:+
Key Pressed:ยด
Traceback (most recent call last):
File "create_dataset.py", line 78, in
main()
File "create_dataset.py", line 74, in main
listen_keyboard()
File "create_dataset.py", line 65, in listen_keyboard
listener.join()
File "C:\Users\jensl\AppData\Local\Programs\Python\Python36\lib\site-packages\pynput_util_init_.py", line 185, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\Users\jensl\AppData\Local\Programs\Python\Python36\lib\site-packages\six.py", line 695, in reraise
raise value.with_traceback(tb)
File "C:\Users\jensl\AppData\Local\Programs\Python\Python36\lib\site-packages\pynput_util_init_.py", line 140, in inner
return f(self, *args, **kwargs)
File "C:\Users\jensl\AppData\Local\Programs\Python\Python36\lib\site-packages\pynput\keyboard_win32.py", line 222, in process
self.on_press(key)
File "C:\Users\jensl\AppData\Local\Programs\Python\Python36\lib\site-packages\pynput_util_init
.py", line 71, in inner
if f(*args) is False:
File "create_dataset.py", line 59, in on_press
save_event_keyboard(data_path, 1, key)
File "create_dataset.py", line 24, in save_event_keyboard
key = get_id(key)
File "c:\bot\game_control.py", line 14, in get_id
return get_keys().index(key.char)
ValueError: 'ยด' is not in list

get_img, save_img, and get_screenshot

So what is the difference between get_img, save_img, and get_screenshot... Why do you need all of them?
which one is supposed to do what?
and in which instances should each of these be used?

ImportError: cannot import name 'imresize' from 'scipy.misc'

I downloaded the code as zip. I had latest python 3 version. I did pip3 install -r requirements.txt it installed all.
but when I ran this command python3 create_dataset.py it gave me this error:

Traceback (most recent call last):
  File "create_dataset.py", line 9, in <module>
    from predict import predict
  File "C:\Users\admin\Desktop\Game-Bot-master\Game-Bot-master\predict.py", line 3, in <module>
    from scipy.misc import imresize
ImportError: cannot import name 'imresize' from 'scipy.misc' (C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\misc\__init__.py)

after that I simply installed the recommended version from the given link in README.md same error

unknown file extension+ValueError: <Key.space: ' '> is not in list

ok so I got like 2 errors when I attempt to run the create_dataset.py, apparently the Keys list doesnt really match up, and also unknown file extension when it tried to save the file into readable training dataset. here are the full traceback

`Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util_init_.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput\keyboard_win32.py", line 240, in process
self.on_press(key)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 60, in on_press
save_event_keyboard(data_path, 1, key)
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 25, in save_event_keyboard
key = get_id(key)
File "C:\Users\Claude\Downloads\Game-Bot-master\game_control.py", line 13, in get_id
return get_keys().index(key)
ValueError: <Key.space: ' '> is not in list
Traceback (most recent call last):
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 79, in
main()
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 75, in main
listen_keyboard()
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 66, in listen_keyboard
listener.join()
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util_init_.py", line 205, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util_init_.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput\keyboard_win32.py", line 240, in process
self.on_press(key)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 60, in on_press
save_event_keyboard(data_path, 1, key)
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 25, in save_event_keyboard
key = get_id(key)
File "C:\Users\Claude\Downloads\Game-Bot-master\game_control.py", line 13, in get_id
return get_keys().index(key)
ValueError: <Key.space: ' '> is not in list
Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util\win32.py", line 375, in _handler
converted = self._convert(code, msg, lpdata)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util\win32.py", line 390, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\PIL\Image.py", line 1987, in save
format = EXTENSION[ext]
KeyError: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util_init_.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util\win32.py", line 379, in _handler
self._handle(code, msg, lpdata)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput\mouse_win32.py", line 190, in handle
self.on_click(data.pt.x, data.pt.y, button, pressed)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 43, in on_click
save_event_mouse(data_path, x, y)
File "C:\Users\Claude\Downloads\Game-Bot-master\create_dataset.py", line 34, in save_event_mouse
save_img(data_path, screenshot)
File "C:\Users\Claude\Downloads\Game-Bot-master\get_dataset.py", line 15, in save_img
imsave(img, path)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\misc\pilutil.py", line 219, in imsave
im.save(name)
File "C:\Users\Claude\AppData\Local\Programs\Python\Python37\lib\site-packages\PIL\Image.py", line 1989, in save
raise ValueError('unknown file extension: {}'.format(ext))
ValueError: unknown file extension:
Process Process-1:`

Many Errors

C:\Program Files\Python36>python3 create_dataset.py

C:\Program Files\Python36>create_dataset.py
Using TensorFlow backend.
Traceback (most recent call last):
File "C:\Program Files\Python36\create_dataset.py", line 12, in
from get_dataset import save_img
File "C:\Program Files\Python36\get_dataset.py", line 4, in
from keras.utils import to_categorical
File "C:\Program Files\Python36\lib\site-packages\keras_init_.py", line 3, in
from . import utils
File "C:\Program Files\Python36\lib\site-packages\keras\utils_init_.py", line 6, in
from . import conv_utils
File "C:\Program Files\Python36\lib\site-packages\keras\utils\conv_utils.py", line 9, in
from .. import backend as K
File "C:\Program Files\Python36\lib\site-packages\keras\backend_init_.py", line 1, in
from .load_backend import epsilon
File "C:\Program Files\Python36\lib\site-packages\keras\backend\load_backend.py", line 90, in
from .tensorflow_backend import *
File "C:\Program Files\Python36\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in
import tensorflow as tf
File "C:\Users\ShuterLive\AppData\Roaming\Python\Python36\site-packages\tensorflow_init_.py", line 98, in
from tensorflow_core import *
File "C:\Users\ShuterLive\AppData\Roaming\Python\Python36\site-packages\tensorflow_core_init_.py", line 40, in
from tensorflow.python.tools import module_util as module_util
File "C:\Users\ShuterLive\AppData\Roaming\Python\Python36\site-packages\tensorflow_init
.py", line 50, in getattr
module = self.load()
File "C:\Users\ShuterLive\AppData\Roaming\Python\Python36\site-packages\tensorflow_init
.py", line 44, in _load
module = importlib.import_module(self.name)
File "C:\Program Files\Python36\lib\importlib_init
.py", line 126, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File "C:\Users\ShuterLive\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python_init
.py", line 52, in
from tensorflow.core.framework.graph_pb2 import *
File "C:\Users\ShuterLive\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\core\framework\graph_pb2.py", line 7, in
from google.protobuf import descriptor as _descriptor
File "c:\users\shuterlive\appdata\roaming\python\python36\site-packages\google\protobuf\descriptor.py", line 47, in
from google.protobuf.pyext import _message
ImportError: DLL load failed: Nie moลผna odnaleลบฤ‡ okreล›lonej procedury.

Module not found error

Well, it kinda describes it perfectly, I'm fairly unfamiliar with python and well coding more broadly, honestly but after extracting the files I tried to launch create_dataset in python 3.9, command promps flash up and close immediately, there was no extra processes running. so instead I opened python and opened it up, worked fine so I press f5 and the screenshot attached comes up.
numpy

I've got no idea whats gone wrong, prehaps its just not compatible with 3.9 but I doubt that, I'm pretty sure I'm doing something wrong

Traceback (most recent call last): File "C:\Users\OneDrive\Desktop\Game-Bot-master\Game-Bot-master\train.py", line 4, in <module> from get_dataset import get_dataset File "C:\Users\OneDrive\Desktop\Game-Bot-master\Game-Bot-master\get_dataset.py", line 4, in <module> from keras.utils import to_categorical ImportError: cannot import name 'to_categorical' from 'keras.utils' (C:\Users\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\keras\utils\__init__.py) ------------------ (program exited with code: 1) Press any key to continue . . .

Traceback (most recent call last): File "C:\Users\OneDrive\Desktop\Game-Bot-master\Game-Bot-master\train.py", line 4, in from get_dataset import get_dataset File "C:\Users\OneDrive\Desktop\Game-Bot-master\Game-Bot-master\get_dataset.py", line 4, in from keras.utils import to_categorical ImportError: cannot import name 'to_categorical' from 'keras.utils' (C:\Users\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\keras\utils_init_.py) ------------------ (program exited with code: 1) Press any key to continue . . .

Can any one help

mac support

Ive been having trouble running this on my macbook pro

The key presses being passed to game_control.py aren't formatted right

I kept getting errors when I tried to run create_dataset.py so I did some debugging and found that, for example, if I press the a key, it is passed to get_id as 'a', which leads to an error saying that 'a' can't be found in the array. If I manually replace return get_keys().index(key) with return get_keys().index('a') it gives the same error which is expected. But, if I replace it with return get_keys().index("a"), it finds it. Thus, it's an issue with how it's being passed to get_id or an issue with get_id itself.

Project is missing some code

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[4004352,1280] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[node training/Adadelta/zeros_8 (defined at F:\Local_API\GameBot\env\lib\site-packages\keras\backend\tensorflow_backend.py:702) ]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

This happens if I use resize more than 150... Should it be only 150 x 150?

With @ardamavi logic only one screenshot is getting saved if same button is pressed. How is that?

count_categori[1] = data.split(',') is not used even. Please advise how can I make this work...

ImportError: cannot import name 'imresize' from 'scipy.misc'

Issue Title: ImportError: cannot import name 'imresize' from 'scipy.misc'

Description:
An exception has occurred while running create_dataset.py:
Exception has occurred: ImportError
cannot import name 'imresize' from 'scipy.misc' (c:\Users\Example\AppData\Local\Programs\Python\Python312\Lib\site-packages\scipy\misc_init_.py)
File "C:\Users\Example\OneDrive\Documents\Game-Bot-master\create_dataset.py", line 8, in
from scipy.misc import imresize
ImportError: cannot import name 'imresize' from 'scipy.misc' (c:\Users\Example\AppData\Local\Programs\Python\Python312\Lib\site-packages\scipy\misc_init_.py)
Details:

Environment: Windows
Python Version: 3.12
Package Versions:
scipy version: Unknown
scipy.misc version: Unknown
Steps to Reproduce:
Run create_dataset.py script.
Observe the ImportError.
Additional Information:
The error suggests that the name 'imresize' cannot be imported from 'scipy.misc'. This might indicate a compatibility issue or a change in the package structure. Please provide the versions of scipy and scipy.misc being used, along with any relevant information about the environment and steps to reproduce the issue.

FileNotFoundError: [Errno 2] No such file or directory: 'Data/Model/model.json'

C:\Users\xxx>cd C:\Users\xxx\Desktop\Game-Bot-master\Game-Bot-master

C:\Users\xxx\Desktop\Game-Bot-master\Game-Bot-master>python ai.py
Using TensorFlow backend.
Traceback (most recent call last):
  File "ai.py", line 58, in <module>
    main()
  File "ai.py", line 14, in main
    model_file = open('Data/Model/model.json', 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'Data/Model/model.json'

C:\Users\xxx\Desktop\Game-Bot-master\Game-Bot-master>

Doesn't initialize a model and cannot import it. Am I missing something?

on_move not defined

my git bash window shows this after installing the requirements...

$ python create_dataset.py
Using TensorFlow backend.
Process Process-1:
Traceback (most recent call last):
  File "C:\Python37\lib\multiprocessing\process.py", line 297, in _bootstrap
    self.run()
  File "C:\Python37\lib\multiprocessing\process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\yawik\Downloads\Game-Bot\create_dataset.py", line 48, in listen_mouse
    with mouse_listener(on_move=on_move, on_click=on_click, on_scroll=on_scroll) as listener:
NameError: name 'on_move' is not defined

good luck and thanks for sharing!

Broken code

main function in create_dataset.py requires img_len but none are provided when running. Remove img_len from main, ImageGrab from PIL is only available for MacOS and Windows, found a workaround but this time nothing is recorded in the newly created directory.

Lots of errors

Hey guys sorry if this is a stupid question but i have everything set up-i think_ and when i run the create dataset file all that comes up is a bunch of errors:

C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py:33: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
img = img.resize((img.size[0] / 12, img.size[1] / 12), resample=Image.BICUBIC)
Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init_.py", line 228, in inner
return f(self, *args, **kwargs)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput\keyboard_win32.py", line 287, in process
self.on_press(key)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init
.py", line 144, in inner
if f(*args) is False:
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 128, in on_press
save_event_keyboard(data_path, 1, key)
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 48, in save_event_keyboard
screenshot = get_screenshot()
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 33, in get_screenshot
img = img.resize((img.size[0] / 12, img.size[1] / 12), resample=Image.BICUBIC)
File "C:\Users\redHe\anaconda3\lib\site-packages\PIL\Image.py", line 2082, in resize
return self.new(self.im.resize(size, resample, box))
TypeError: integer argument expected, got float
Traceback (most recent call last):
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 151, in
main()
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 147, in main
listen_keyboard()
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 134, in listen_keyboard
listener.join()
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init
.py", line 276, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\Users\redHe\anaconda3\lib\site-packages\six.py", line 718, in reraise
raise value.with_traceback(tb)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init_.py", line 228, in inner
return f(self, *args, **kwargs)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput\keyboard_win32.py", line 287, in process
self.on_press(key)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init
.py", line 144, in inner
if f(*args) is False:
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 128, in on_press
save_event_keyboard(data_path, 1, key)
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 48, in save_event_keyboard
screenshot = get_screenshot()
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 33, in get_screenshot
img = img.resize((img.size[0] / 12, img.size[1] / 12), resample=Image.BICUBIC)
File "C:\Users\redHe\anaconda3\lib\site-packages\PIL\Image.py", line 2082, in resize
return self._new(self.im.resize(size, resample, box))
TypeError: integer argument expected, got float
Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util\win32.py", line 386, in _handler
converted = self._convert(code, msg, lpdata)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util\win32.py", line 401, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init_.py", line 228, in inner
return f(self, *args, **kwargs)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util\win32.py", line 390, in _handler
self._handle(code, msg, lpdata)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput\mouse_win32.py", line 208, in handle
self.on_move(data.pt.x, data.pt.y)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init
.py", line 144, in inner
if f(*args) is False:
TypeError: on_move() takes 1 positional argument but 2 were given
Process Process-1:
Traceback (most recent call last):
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util\win32.py", line 386, in _handler
converted = self._convert(code, msg, lpdata)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util\win32.py", line 401, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\redHe\anaconda3\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Users\redHe\anaconda3\lib\multiprocessing\process.py", line 108, in run
self._target(*self.args, **self.kwargs)
File "C:\Users\redHe\PycharmProjects\pythonProject\venv\create_dataset.py", line 115, in listen_mouse
listener.join()
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init
.py", line 276, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\Users\redHe\anaconda3\lib\site-packages\six.py", line 718, in reraise
raise value.with_traceback(tb)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init
.py", line 228, in inner
return f(self, *args, **kwargs)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util\win32.py", line 390, in _handler
self._handle(code, msg, lpdata)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput\mouse_win32.py", line 208, in handle
self.on_move(data.pt.x, data.pt.y)
File "C:\Users\redHe\anaconda3\lib\site-packages\pynput_util_init
.py", line 144, in inner
if f(*args) is False:
TypeError: on_move() takes 1 positional argument but 2 were given

versions

can u tell me what versions u used of those in the requirements list?
this would be so awesome if i just got it to work.
you should really update this, so many people would love this!

ValueError: 'arr' does not have a suitable array shape for any mode.

$ python create_dataset.py
Using TensorFlow backend.
Unhandled exception in listener callback
Traceback (most recent call last):
  File "C:\Python37\lib\site-packages\pynput\_util\win32.py", line 375, in _handler
    converted = self._convert(code, msg, lpdata)
  File "C:\Python37\lib\site-packages\pynput\_util\win32.py", line 390, in _convert
    raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python37\lib\site-packages\pynput\_util\__init__.py", line 157, in inner
    return f(self, *args, **kwargs)
  File "C:\Python37\lib\site-packages\pynput\_util\win32.py", line 379, in _handler
    self._handle(code, msg, lpdata)
  File "C:\Python37\lib\site-packages\pynput\mouse\_win32.py", line 190, in _handle
    self.on_click(data.pt.x, data.pt.y, button, pressed)
  File "C:\Python37\lib\site-packages\pynput\_util\__init__.py", line 78, in inner
    if f(*args) is False:
  File "C:\Users\yawik\Downloads\Game-Bot\create_dataset.py", line 43, in on_click
    save_event_mouse(data_path, x, y)
  File "C:\Users\yawik\Downloads\Game-Bot\create_dataset.py", line 34, in save_event_mouse
    save_img(data_path, screenshot)
  File "C:\Users\yawik\Downloads\Game-Bot\get_dataset.py", line 15, in save_img
    imsave(path, img)
  File "C:\Python37\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
    return func(*args, **kwds)
  File "C:\Python37\lib\site-packages\scipy\misc\pilutil.py", line 217, in imsave
    im = toimage(arr, channel_axis=2)
  File "C:\Python37\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
    return func(*args, **kwds)
  File "C:\Python37\lib\site-packages\scipy\misc\pilutil.py", line 327, in toimage
    raise ValueError("'arr' does not have a suitable array shape for "
ValueError: 'arr' does not have a suitable array shape for any mode.
Process Process-1:
Traceback (most recent call last):
  File "C:\Python37\lib\site-packages\pynput\_util\win32.py", line 375, in _handler
    converted = self._convert(code, msg, lpdata)
  File "C:\Python37\lib\site-packages\pynput\_util\win32.py", line 390, in _convert
    raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python37\lib\multiprocessing\process.py", line 297, in _bootstrap
    self.run()
  File "C:\Python37\lib\multiprocessing\process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\yawik\Downloads\Game-Bot\create_dataset.py", line 52, in listen_mouse
    listener.join()
  File "C:\Python37\lib\site-packages\pynput\_util\__init__.py", line 205, in join
    six.reraise(exc_type, exc_value, exc_traceback)
  File "C:\Python37\lib\site-packages\six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "C:\Python37\lib\site-packages\pynput\_util\__init__.py", line 157, in inner
    return f(self, *args, **kwargs)
  File "C:\Python37\lib\site-packages\pynput\_util\win32.py", line 379, in _handler
    self._handle(code, msg, lpdata)
  File "C:\Python37\lib\site-packages\pynput\mouse\_win32.py", line 190, in _handle
    self.on_click(data.pt.x, data.pt.y, button, pressed)
  File "C:\Python37\lib\site-packages\pynput\_util\__init__.py", line 78, in inner
    if f(*args) is False:
  File "C:\Users\yawik\Downloads\Game-Bot\create_dataset.py", line 43, in on_click
    save_event_mouse(data_path, x, y)
  File "C:\Users\yawik\Downloads\Game-Bot\create_dataset.py", line 34, in save_event_mouse
    save_img(data_path, screenshot)
  File "C:\Users\yawik\Downloads\Game-Bot\get_dataset.py", line 15, in save_img
    imsave(path, img)
  File "C:\Python37\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
    return func(*args, **kwds)
  File "C:\Python37\lib\site-packages\scipy\misc\pilutil.py", line 217, in imsave
    im = toimage(arr, channel_axis=2)
  File "C:\Python37\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
    return func(*args, **kwds)
  File "C:\Python37\lib\site-packages\scipy\misc\pilutil.py", line 327, in toimage
    raise ValueError("'arr' does not have a suitable array shape for "
ValueError: 'arr' does not have a suitable array shape for any mode.

tried running it after the last fix...getting this now :/
i really want this to work!

Error after run create dataset

This is my anaconda log when I run create dataset and I press "a":

(base) C:\Users\Xander>python "D:\Game-Bot-master\Game-Bot-master\create_dataset.py"
D:\Anaconda\lib\site-packages\h5py_init_.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as register_converters
Using TensorFlow backend.
D:\Anaconda\lib\site-packages\h5py_init
.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from .conv import register_converters as register_converters
Using TensorFlow backend.
Traceback (most recent call last):
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 76, in
main()
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 72, in main
listen_keyboard()
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 63, in listen_keyboard
listener.join()
File "D:\Anaconda\lib\site-packages\pynput_util_init
.py", line 185, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "D:\Anaconda\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "D:\Anaconda\lib\site-packages\pynput_util_init
.py", line 140, in inner
return f(self, *args, **kwargs)
File "D:\Anaconda\lib\site-packages\pynput\keyboard_win32.py", line 237, in process
self.on_press(key)
File "D:\Anaconda\lib\site-packages\pynput_util_init
.py", line 71, in inner
if f(*args) is False:
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 57, in on_press
save_event_keyboard(data_path, 1, key)
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 25, in save_event_keyboard
key = get_id(key)
File "D:\Game-Bot-master\Game-Bot-master\game_control.py", line 13, in get_id
return get_keys().index(key)
ValueError: 'a' is not in list
Process Process-1:
Traceback (most recent call last):
File "D:\Anaconda\lib\site-packages\pynput_util\win32.py", line 375, in _handler
converted = self._convert(code, msg, lpdata)
File "D:\Anaconda\lib\site-packages\pynput_util\win32.py", line 387, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Anaconda\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "D:\Anaconda\lib\multiprocessing\process.py", line 93, in run
self._target(*self.args, **self.kwargs)
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 49, in listen_mouse
listener.join()
File "D:\Anaconda\lib\site-packages\pynput_util_init
.py", line 185, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "D:\Anaconda\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "D:\Anaconda\lib\site-packages\pynput_util_init
.py", line 140, in inner
return f(self, *args, **kwargs)
File "D:\Anaconda\lib\site-packages\pynput_util\win32.py", line 379, in _handler
self._handle(code, msg, lpdata)
File "D:\Anaconda\lib\site-packages\pynput\mouse_win32.py", line 186, in handle
self.on_click(data.pt.x, data.pt.y, button, pressed)
File "D:\Anaconda\lib\site-packages\pynput_util_init
.py", line 71, in inner
if f(*args) is False:
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 43, in on_click
save_event_mouse(data_path, x, y)
File "D:\Game-Bot-master\Game-Bot-master\create_dataset.py", line 34, in save_event_mouse
save_img(data_path, screenshot)
File "D:\Game-Bot-master\Game-Bot-master\get_dataset.py", line 15, in save_img
imsave(path, img)
File "D:\Anaconda\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "D:\Anaconda\lib\site-packages\scipy\misc\pilutil.py", line 217, in imsave
im = toimage(arr, channel_axis=2)
File "D:\Anaconda\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "D:\Anaconda\lib\site-packages\scipy\misc\pilutil.py", line 327, in toimage
raise ValueError("'arr' does not have a suitable array shape for "
ValueError: 'arr' does not have a suitable array shape for any mode.

ValueError: 'u' is not in list, ValueError: 'arr' does not have a suitable array shape for any mode.

I seem to be getting this error when i press a key or click the mouse but not everytime

Using TensorFlow backend.
down
Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init_.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput\keyboard_win32.py", line 240, in process
self.on_press(key)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "create_dataset.py", line 61, in on_press
save_event_keyboard(data_path, 1, key)
File "create_dataset.py", line 25, in save_event_keyboard
key = get_id(key)
File "C:\tensorflow1\Bot\Game-Bot-master\game_control.py", line 13, in get_id
return get_keys().index(key)
ValueError: 'u' is not in list

####these errors follow shortly after the initial error above

Traceback (most recent call last):
File "create_dataset.py", line 81, in
main()
File "create_dataset.py", line 77, in main
listen_keyboard()
File "create_dataset.py", line 68, in listen_keyboard
listener.join()
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init_.py", line 205, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init_.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput\keyboard_win32.py", line 240, in process
self.on_press(key)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "create_dataset.py", line 61, in on_press
save_event_keyboard(data_path, 1, key)
File "create_dataset.py", line 25, in save_event_keyboard
key = get_id(key)
File "C:\tensorflow1\Bot\Game-Bot-master\game_control.py", line 13, in get_id
return get_keys().index(key)
ValueError: 'u' is not in list
Using TensorFlow backend.
Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util\win32.py", line 375, in _handler
converted = self._convert(code, msg, lpdata)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util\win32.py", line 390, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init_.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util\win32.py", line 379, in _handler
self._handle(code, msg, lpdata)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput\mouse_win32.py", line 190, in handle
self.on_click(data.pt.x, data.pt.y, button, pressed)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "C:\tensorflow1\Bot\Game-Bot-master\create_dataset.py", line 43, in on_click
save_event_mouse(data_path, x, y)
File "C:\tensorflow1\Bot\Game-Bot-master\create_dataset.py", line 34, in save_event_mouse
save_img(data_path, screenshot)
File "C:\tensorflow1\Bot\Game-Bot-master\get_dataset.py", line 15, in save_img
imsave(path, img)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\scipy\misc\pilutil.py", line 217, in imsave
im = toimage(arr, channel_axis=2)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\scipy\misc\pilutil.py", line 327, in toimage
raise ValueError("'arr' does not have a suitable array shape for "
ValueError: 'arr' does not have a suitable array shape for any mode.
Process Process-1:
Traceback (most recent call last):
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util\win32.py", line 375, in _handler
converted = self._convert(code, msg, lpdata)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util\win32.py", line 390, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\multiprocessing\process.py", line 99, in run
self._target(*self.args, **self.kwargs)
File "C:\tensorflow1\Bot\Game-Bot-master\create_dataset.py", line 52, in listen_mouse
listener.join()
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init
.py", line 205, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init
.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util\win32.py", line 379, in _handler
self._handle(code, msg, lpdata)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput\mouse_win32.py", line 190, in handle
self.on_click(data.pt.x, data.pt.y, button, pressed)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "C:\tensorflow1\Bot\Game-Bot-master\create_dataset.py", line 43, in on_click
save_event_mouse(data_path, x, y)
File "C:\tensorflow1\Bot\Game-Bot-master\create_dataset.py", line 34, in save_event_mouse
save_img(data_path, screenshot)
File "C:\tensorflow1\Bot\Game-Bot-master\get_dataset.py", line 15, in save_img
imsave(path, img)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\scipy\misc\pilutil.py", line 217, in imsave
im = toimage(arr, channel_axis=2)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\Users\proni\Anaconda3\envs\tensorflow2\lib\site-packages\scipy\misc\pilutil.py", line 327, in toimage
raise ValueError("'arr' does not have a suitable array shape for "
ValueError: 'arr' does not have a suitable array shape for any mode.

model.jason error

(base) C:\Users\Naga Ravi\Downloads\Game-Bot-master\Game-Bot-master>python ai.py
Using TensorFlow backend.
Traceback (most recent call last):
File "ai.py", line 58, in
main()
File "ai.py", line 14, in main
model_file = open('Data/Model/model.json', 'r')
FileNotFoundError: [Errno 2] No such file or directory: 'Data/Model/model.json'

Error in create_dataset.py

So I was following the instructions as shown in the readme but it gave me the following error:

Traceback (most recent call last): File "create_dataset.py", line 7, in <module> from PIL import ImageGrab ModuleNotFoundError: No module named 'PIL'

One of the modules fail to install when running the install command.

Hope this gets worked out, I really wanted to toy around with this thing. :/

UPDATE: I ran the install command again, which returned the same error but this time when I run the create dataset program, it spits out this peculiar error Traceback (most recent call last): File "create_dataset.py", line 8, in <module> from game_control import * File "C:\Users\REDACTED\Game-Bot\game_control.py", line 2, in <module> from pynput.mouse import Button, Controller as Mouse ModuleNotFoundError: No module named 'pynput'

Hmm its to long

Hi there
Basicly i couldn't make tensorflow work on 3.6.0 so i decided to use miniconda (with nevest wersion of python) and then i was able to make it running.
my steps:
-instaling miniconda
-installed numpy
-instaled tensorflow
-tried arround PIL and realised that it works on 2.7
-googled this --force html5lib -> pip install Pillow
-then I looked at your site and I realized that you proved file with packages so what i did was
pip install -r requirements.txt
and there is the final as tensorflow was able to run i tried to create data set and this is list of errors that is gave me

Using TensorFlow backend.
Using TensorFlow backend.
Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util\win32.py", line 375, in _handler
converted = self._convert(code, msg, lpdata)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util\win32.py", line 390, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init_.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util\win32.py", line 379, in _handler
self._handle(code, msg, lpdata)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput\mouse_win32.py", line 190, in handle
self.on_click(data.pt.x, data.pt.y, button, pressed)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "C:\Users\mchin\Downloads\Game-Bot-master\create_dataset.py", line 43, in on_click
save_event_mouse(data_path, x, y)
File "C:\Users\mchin\Downloads\Game-Bot-master\create_dataset.py", line 34, in save_event_mouse
save_img(data_path, screenshot)
File "C:\Users\mchin\Downloads\Game-Bot-master\get_dataset.py", line 15, in save_img
imsave(path, img)
File "C:\ProgramData\Miniconda3\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\ProgramData\Miniconda3\lib\site-packages\scipy\misc\pilutil.py", line 217, in imsave
im = toimage(arr, channel_axis=2)
File "C:\ProgramData\Miniconda3\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\ProgramData\Miniconda3\lib\site-packages\scipy\misc\pilutil.py", line 327, in toimage
raise ValueError("'arr' does not have a suitable array shape for "
ValueError: 'arr' does not have a suitable array shape for any mode.
Process Process-1:
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util\win32.py", line 375, in _handler
converted = self._convert(code, msg, lpdata)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util\win32.py", line 390, in _convert
raise NotImplementedError()
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
File "C:\ProgramData\Miniconda3\lib\multiprocessing\process.py", line 99, in run
self.target(*self.args, **self.kwargs)
File "C:\Users\mchin\Downloads\Game-Bot-master\create_dataset.py", line 52, in listen_mouse
listener.join()
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init
.py", line 205, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\ProgramData\Miniconda3\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init
.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util\win32.py", line 379, in handler
self.handle(code, msg, lpdata)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput\mouse_win32.py", line 190, in handle
self.on_click(data.pt.x, data.pt.y, button, pressed)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "C:\Users\mchin\Downloads\Game-Bot-master\create_dataset.py", line 43, in on_click
save_event_mouse(data_path, x, y)
File "C:\Users\mchin\Downloads\Game-Bot-master\create_dataset.py", line 34, in save_event_mouse
save_img(data_path, screenshot)
File "C:\Users\mchin\Downloads\Game-Bot-master\get_dataset.py", line 15, in save_img
imsave(path, img)
File "C:\ProgramData\Miniconda3\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\ProgramData\Miniconda3\lib\site-packages\scipy\misc\pilutil.py", line 217, in imsave
im = toimage(arr, channel_axis=2)
File "C:\ProgramData\Miniconda3\lib\site-packages\numpy\lib\utils.py", line 101, in newfunc
return func(*args, **kwds)
File "C:\ProgramData\Miniconda3\lib\site-packages\scipy\misc\pilutil.py", line 327, in toimage
raise ValueError("'arr' does not have a suitable array shape for "
ValueError: 'arr' does not have a suitable array shape for any mode.
Unhandled exception in listener callback
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init
.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput\keyboard_win32.py", line 240, in process
self.on_press(key)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "create_dataset.py", line 60, in on_press
save_event_keyboard(data_path, 1, key)
File "create_dataset.py", line 25, in save_event_keyboard
key = get_id(key)
File "C:\Users\mchin\Downloads\Game-Bot-master\game_control.py", line 13, in get_id
return get_keys().index(key)
ValueError: 'p' is not in list
Traceback (most recent call last):
File "create_dataset.py", line 79, in
main()
File "create_dataset.py", line 75, in main
listen_keyboard()
File "create_dataset.py", line 66, in listen_keyboard
listener.join()
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init.py", line 205, in join
six.reraise(exc_type, exc_value, exc_traceback)
File "C:\ProgramData\Miniconda3\lib\site-packages\six.py", line 692, in reraise
raise value.with_traceback(tb)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init.py", line 157, in inner
return f(self, *args, **kwargs)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput\keyboard_win32.py", line 240, in process
self.on_press(key)
File "C:\ProgramData\Miniconda3\lib\site-packages\pynput_util_init
.py", line 78, in inner
if f(*args) is False:
File "create_dataset.py", line 60, in on_press
save_event_keyboard(data_path, 1, key)
File "create_dataset.py", line 25, in save_event_keyboard
key = get_id(key)
File "C:\Users\mchin\Downloads\Game-Bot-master\game_control.py", line 13, in get_id
return get_keys().index(key)

I have no idee how to make this program runing please help me solve this

No linux?

Is there some way to adapt it to run under linux?

issue with imwrite

File "c:\Users\Timmy\Documents\game repo\Game-Bot\create_dataset.py", line 47, in on_click
save_event_mouse(data_path, x, y)
File "c:\Users\Timmy\Documents\game repo\Game-Bot\create_dataset.py", line 38, in save_event_mouse
save_img(data_path, screenshot)
File "c:\Users\Timmy\Documents\game repo\Game-Bot\get_dataset.py", line 18, in save_img
imwrite(path, img)
cv2.error: OpenCV(4.7.0) ๐Ÿ‘Ž error: (-5:Bad argument) in function 'imwrite'

Overload resolution failed:

  • Can't convert object to 'str' for 'filename'
  • Can't convert object to 'str' for 'filename'

SyntaxError: invalid syntax

python3 create_dataset.py
File "", line 1
python3 create_dataset.py
^
SyntaxError: invalid syntax

Any idea what kind of syntax is missing?

Tensorflow and keras doesn't give me to create_dataset and also code doesn't actually worked then i made everything like readme file so i have no idea what to do

Also i tried fixed patches from users none of them worked for me. I made enviroment and installed libraires from requirements.txt somehow once i managed it to work and make dataset but then train.py and get_model.py gave me alot of errors after every fix or error another appeares. Maybe tensorflow version is too old and this code needs update idk (need help)

Updated Code - Keep running into errors

I was wondering if you have a more updated code that you could load to Git. I've been trying to work around the SciPy update and have tried using many other image retrievals to get passed that part but continue hitting other errors. the imresize is no longer a thing so tried both imsave and even using imageio and cv to create my arrays.

Any help would be much appreciated.

how do i fix this.

Traceback (most recent call last):
File "D:\downloads\Game-Bot-master\get_dataset.py", line 21, in get_dataset
X = np.load('Data/npy_train_data/X.npy')
File "C:\Users\For36\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\lib\npyio.py", line 416, in load
fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: 'Data/npy_train_data/X.npy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 31, in
main()
File "train.py", line 24, in main
X, X_test, Y, Y_test = get_dataset()
File "D:\downloads\Game-Bot-master\get_dataset.py", line 41, in get_dataset
Y = to_categorical(Y, count_categori[0]+1)
File "C:\Users\For36\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\np_utils.py", line 72, in to_categorical
num_classes = np.max(y) + 1
File "<array_function internals>", line 6, in amax
File "C:\Users\For36\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\fromnumeric.py", line 2706, in amax
keepdims=keepdims, initial=initial, where=where)
File "C:\Users\For36\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\fromnumeric.py", line 87, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.