Giter Site home page Giter Site logo

aaronjny / lotto Goto Github PK

View Code? Open in Web Editor NEW
93.0 6.0 62.0 209 KB

使用循环神经网络预测大乐透开奖结果。仅为技术研究而产生的娱乐性质的小实验,赚不了钱,赚不了钱,赚不了钱,重要的事情说三遍。

Python 100.00%

lotto's Issues

训练后,没法保存进度...

麻烦更新一下.

W tensorflow/core/framework/op_kernel.cc:1753] OP_REQUIRES failed at save_restore_v2_ops.cc:134 : Resource exhausted: checkpoints/model_checkpoint_35_temp_1b4ee8a5d4f64fbdaeb08d6891472655/part-00000-of-00001.data-00000-of-00001.tempstate4953384194912554988; No space left on device
Traceback (most recent call last):
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1702, in save_v2
tld.op_callbacks, prefix, tensor_names, shape_and_slices, tensors)
tensorflow.python.eager.core._FallbackException: This function does not handle the case of the path where all inputs are not already EagerTensors.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train_and_show.py", line 64, in
model.save_weights('{}/model_checkpoint_{}'.format(settings.CHECKPOINTS_PATH, epoch))
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/network.py", line 1167, in save_weights
self._trackable_saver.save(filepath, session=session)
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/tracking/util.py", line 1187, in save
file_prefix=file_prefix_tensor, object_graph_tensor=object_graph_tensor)
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/tracking/util.py", line 1135, in _save_cached_when_graph_building
save_op = saver.save(file_prefix)
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saving/functional_saver.py", line 256, in save
sharded_saves.append(saver.save(shard_prefix))
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/training/saving/functional_saver.py", line 73, in save
return io_ops.save_v2(file_prefix, tensor_names, tensor_slices, tensors)
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1708, in save_v2
ctx=ctx)
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1730, in save_v2_eager_fallback
ctx=ctx, name=name)
File "/Users/xiangyutao/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/execute.py", line 60, in quick_execute
inputs, attrs, num_outputs)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: checkpoints/model_checkpoint
(b(b((((b(((((base)

预测结果全部重复

大神, 我用最新的大乐透结果进行预测。先运行python3 train_with_whole_dataset.py,然后运行predict.py,结果预测结果全是最后一期的开奖号码(第1注 8 19 29 34 35 6 11,这个结果是更新下来的开奖数据中的最新一期结果)。这个问题出在哪?

[root@localhost lotto-master]# python3 predict.py
2020-12-04 09:55:42.890432: 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-12-04 09:55:42.901135: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 1696070000 Hz
2020-12-04 09:55:42.902469: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x3da0480 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-12-04 09:55:42.902529: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Model: "functional_1"


Layer (type) Output Shape Param # Connected to

x1 (InputLayer) [(None, 256, 35)] 0


x2 (InputLayer) [(None, 256, 35)] 0


x3 (InputLayer) [(None, 256, 35)] 0


x4 (InputLayer) [(None, 256, 35)] 0


x5 (InputLayer) [(None, 256, 35)] 0


x6 (InputLayer) [(None, 256, 12)] 0


x7 (InputLayer) [(None, 256, 12)] 0


bidirectional (Bidirectional) (None, 256, 128) 51200 x1[0][0]


bidirectional_2 (Bidirectional) (None, 256, 128) 51200 x2[0][0]


bidirectional_4 (Bidirectional) (None, 256, 128) 51200 x3[0][0]


bidirectional_6 (Bidirectional) (None, 256, 128) 51200 x4[0][0]


bidirectional_8 (Bidirectional) (None, 256, 128) 51200 x5[0][0]


bidirectional_10 (Bidirectional (None, 256, 128) 39424 x6[0][0]


bidirectional_12 (Bidirectional (None, 256, 128) 39424 x7[0][0]


dropout (Dropout) (None, 256, 128) 0 bidirectional[0][0]


dropout_2 (Dropout) (None, 256, 128) 0 bidirectional_2[0][0]


dropout_4 (Dropout) (None, 256, 128) 0 bidirectional_4[0][0]


dropout_6 (Dropout) (None, 256, 128) 0 bidirectional_6[0][0]


dropout_8 (Dropout) (None, 256, 128) 0 bidirectional_8[0][0]


dropout_10 (Dropout) (None, 256, 128) 0 bidirectional_10[0][0]


dropout_12 (Dropout) (None, 256, 128) 0 bidirectional_12[0][0]


bidirectional_1 (Bidirectional) (None, 256, 128) 98816 dropout[0][0]


bidirectional_3 (Bidirectional) (None, 256, 128) 98816 dropout_2[0][0]


bidirectional_5 (Bidirectional) (None, 256, 128) 98816 dropout_4[0][0]


bidirectional_7 (Bidirectional) (None, 256, 128) 98816 dropout_6[0][0]


bidirectional_9 (Bidirectional) (None, 256, 128) 98816 dropout_8[0][0]


bidirectional_11 (Bidirectional (None, 256, 128) 98816 dropout_10[0][0]


bidirectional_13 (Bidirectional (None, 256, 128) 98816 dropout_12[0][0]


dropout_1 (Dropout) (None, 256, 128) 0 bidirectional_1[0][0]


dropout_3 (Dropout) (None, 256, 128) 0 bidirectional_3[0][0]


dropout_5 (Dropout) (None, 256, 128) 0 bidirectional_5[0][0]


dropout_7 (Dropout) (None, 256, 128) 0 bidirectional_7[0][0]


dropout_9 (Dropout) (None, 256, 128) 0 bidirectional_9[0][0]


dropout_11 (Dropout) (None, 256, 128) 0 bidirectional_11[0][0]


dropout_13 (Dropout) (None, 256, 128) 0 bidirectional_13[0][0]


time_distributed (TimeDistribut (None, 256, 105) 13545 dropout_1[0][0]


time_distributed_1 (TimeDistrib (None, 256, 105) 13545 dropout_3[0][0]


time_distributed_2 (TimeDistrib (None, 256, 105) 13545 dropout_5[0][0]


time_distributed_3 (TimeDistrib (None, 256, 105) 13545 dropout_7[0][0]


time_distributed_4 (TimeDistrib (None, 256, 105) 13545 dropout_9[0][0]


time_distributed_5 (TimeDistrib (None, 256, 36) 4644 dropout_11[0][0]


time_distributed_6 (TimeDistrib (None, 256, 36) 4644 dropout_13[0][0]


flatten (Flatten) (None, 26880) 0 time_distributed[0][0]


flatten_1 (Flatten) (None, 26880) 0 time_distributed_1[0][0]


flatten_2 (Flatten) (None, 26880) 0 time_distributed_2[0][0]


flatten_3 (Flatten) (None, 26880) 0 time_distributed_3[0][0]


flatten_4 (Flatten) (None, 26880) 0 time_distributed_4[0][0]


flatten_5 (Flatten) (None, 9216) 0 time_distributed_5[0][0]


flatten_6 (Flatten) (None, 9216) 0 time_distributed_6[0][0]


dense_1 (Dense) (None, 105) 2822505 flatten[0][0]


dense_3 (Dense) (None, 105) 2822505 flatten_1[0][0]


dense_5 (Dense) (None, 105) 2822505 flatten_2[0][0]


dense_7 (Dense) (None, 105) 2822505 flatten_3[0][0]


dense_9 (Dense) (None, 105) 2822505 flatten_4[0][0]


dense_11 (Dense) (None, 36) 331812 flatten_5[0][0]


dense_13 (Dense) (None, 36) 331812 flatten_6[0][0]


concatenate (Concatenate) (None, 525) 0 dense_1[0][0]
dense_3[0][0]
dense_5[0][0]
dense_7[0][0]
dense_9[0][0]


concatenate_1 (Concatenate) (None, 72) 0 dense_11[0][0]
dense_13[0][0]


y1 (Dense) (None, 35) 18410 concatenate[0][0]


y2 (Dense) (None, 35) 18410 concatenate[0][0]


y3 (Dense) (None, 35) 18410 concatenate[0][0]


y4 (Dense) (None, 35) 18410 concatenate[0][0]


y5 (Dense) (None, 35) 18410 concatenate[0][0]


y6 (Dense) (None, 12) 876 concatenate_1[0][0]


y7 (Dense) (None, 12) 876 concatenate_1[0][0]

Total params: 15,973,524
Trainable params: 15,973,524
Non-trainable params: 0


本次预测结果如下:
第1注 8 19 29 34 35 6 11
第2注 8 19 29 34 35 6 11
第3注 8 19 29 34 35 6 11
第4注 8 19 29 34 35 6 11
第5注 8 19 29 34 35 6 11
第6注 8 19 29 34 35 6 11
第7注 8 19 29 34 35 6 11
第8注 8 19 29 34 35 6 11
第9注 8 19 29 34 35 6 11
第10注 8 19 29 34 35 6 11

是否考虑过用transformer代替LSTM

LSTM循环卷积神经网络预测出的结果和最新一期的数据十分相似,
大佬是否考虑过把LSTM改用transformer?
改变循环串联的结构,应该不会再出现这种全部重复的问题?

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.