ryansaxe / mtg Goto Github PK
View Code? Open in Web Editor NEWState of the Art Magic: the Gathering Draft and DeckBuilder AI.
License: Apache License 2.0
State of the Art Magic: the Gathering Draft and DeckBuilder AI.
License: Apache License 2.0
Saw a commit mentioning DMU, so I tried it out but get this error.
(my_env) C:\GitHub\mtg-main\mtg\scripts>python preprocess.py --expansion DMU --game_data C:\GitHub\17lands\game_data.csv --draft_data c:\GitHub\17lands\draft_data.csv --expansion_fname c:\GitHub\17lands\DMU.pkl
Traceback (most recent call last):
File "C:\GitHub\mtg-main\mtg\scripts\preprocess.py", line 34, in <module>
main()
File "C:\GitHub\mtg-main\mtg\scripts\preprocess.py", line 8, in main
expansion = EXPANSION(bo1=FLAGS.game_data, draft=FLAGS.draft_data, ml_data=True)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\obj\expansion.py", line 383, in __init__
super().__init__(
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\obj\expansion.py", line 25, in __init__
self.bo1 = self.process_data(bo1, name="bo1")
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\obj\expansion.py", line 53, in process_data
df = load_data(file_or_df, self.cards.copy(), name=name)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\obj\dataloading_utils.py", line 10, in load_data
return load_bo1_data(filename, cards)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\obj\dataloading_utils.py", line 67, in load_bo1_data
df = pd.read_csv(
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
return func(*args, **kwargs)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\util\_decorators.py", line 331, in wrapper
return func(*args, **kwargs)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\io\parsers\readers.py", line 950, in read_csv
return _read(filepath_or_buffer, kwds)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\io\parsers\readers.py", line 605, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\io\parsers\readers.py", line 1442, in __init__
self._engine = self._make_engine(f, self.engine)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\io\parsers\readers.py", line 1753, in _make_engine
return mapping[engine](f, **self.options)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 135, in __init__
self._validate_usecols_names(usecols, self.orig_names)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\pandas\io\parsers\base_parser.py", line 917, in _validate_usecols_names
raise ValueError(
ValueError: Usecols do not match columns, columns expected but not found: ['user_win_rate_bucket']
(my_env) C:\GitHub\mtg-main\mtg\scripts>
I might be doing something wrong, but here's my output anyway.
(my_env) C:\GitHub\mtg-main\mtg\scripts>python train_drafter.py --expansion_fname c:\GitHub\17lands\DMU.pkl --model_name c:\GitHub\17lands\DMU_draft_model
2022-10-21 23:08:37.817430: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-10-21 23:08:39.403046: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1616] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3491 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3060 Laptop GPU, pci bus id: 0000:01:00.0, compute capability: 8.6
C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\keras\initializers\initializers_v2.py:120: UserWarning: The initializer GlorotNormal is unseeded and being called multiple times, which will return identical values each time (even if the initializer is unseeded). Please update your code to provide a seed to the initializer, or avoid using the same initalizer instance more than once.
warnings.warn(
Epoch 1/1: 0%| | 0/4947 [00:00<?, ?Batch/s]2022-10-21 23:08:48.728530: I tensorflow/stream_executor/cuda/cuda_blas.cc:1614] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
2022-10-21 23:08:49.726358: W tensorflow/core/framework/op_kernel.cc:1768] INVALID_ARGUMENT: required broadcastable shapes
Traceback (most recent call last):
File "C:\GitHub\mtg-main\mtg\scripts\train_drafter.py", line 173, in <module>
main()
File "C:\GitHub\mtg-main\mtg\scripts\train_drafter.py", line 49, in main
trainer.train(
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\ml\trainer.py", line 127, in train
loss, metrics = self._step(
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\ml\trainer.py", line 66, in _step
metrics = self.model.compute_metrics(
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\mtg\ml\models.py", line 392, in compute_metrics
tf.keras.metrics.sparse_top_k_categorical_accuracy(true, pred, 1)
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\marku\anaconda3\envs\my_env\lib\site-packages\tensorflow\python\framework\ops.py", line 7209, in raise_from_not_ok_status
raise core._status_to_exception(e) from None # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__Mul_device_/job:localhost/replica:0/task:0/device:GPU:0}} required broadcastable shapes [Op:Mul]
Epoch 1/1: 0%| | 0/4947 [00:09<?, ?Batch/s]
(my_env) C:\GitHub\mtg-main\mtg\scripts>
Do you have discord, currently rank 1 and have some ideas on bot metrics. Want to bounce off some ideas and see which works
Sorry to reach out this way ...
Thought it might be different enough to catch ur eye w/o being too annoying
i @-d u over on Twitter with an idea for a neural net / ML project that i think could help me at work
& ur MTG draft helper came to mind!
I was a huge fan listening to some podcasts in which u detailed building / testing this algorithm
so I figured ... Why not shoot my shot trying to contact u ๐
hope ur having a fantastic Tuesday!
Jackson
First, thank you for sharing your experimentations and results. I am thinking about making a similar project, and I have a few questions regarding your approach and implementation:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.