jindeok / Lottery_Prediction

LSTM based lottery forecast model
14 stars 10 forks source link

No predicted number #2

Open CyberttJOe opened 1 year ago

CyberttJOe commented 1 year ago

Hi Dr Jindeok,

using the same script and data, but with the latest Tensorflow version, i run the Preprocessing_Rawdata script, the result is empty.

image


NameError Traceback (most recent call last) Cell In[23], line 1 ----> 1 predicted

NameError: name 'predicted' is not defined

Could you give me some suggestions.

Thanks a lot !

Cybertt

jindeok commented 1 year ago

The script Preprocessing_Rawdata.ipynb is for providing reference code of preprocessing raw data in case you want to implement latest Lottery data (and the codes are not trimmed. I'm sorry for this).

If you persist on using that script, delete "predicted" variabe and use "ww" variable instead.

But I recommend you to simply run "main.py" in your preferred IDE.

Have a nice day :)

CyberttJOe commented 1 year ago

Simply running 'main.py' scripts lead to below error:

2023-03-03 13:26:53.113558: 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. 958/958 - 3s - loss: 0.1354 - 3s/epoch - 3ms/step Traceback (most recent call last): File "C:\eastmoney\Lottery_prediction\main.py", line 47, in prediction_number_set = LotteryLSTM.predict_lottery_numbers(args.mode2, args.trial) File "C:\eastmoney\Lottery_prediction\model.py", line 43, in predict_lottery_numbers yhat = self.model.predict(self.test_X) # [1x45] dim File "C:\Users\wzkong\miniconda3\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\wzkong\miniconda3\lib\site-packages\keras\engine\training.py", line 2375, in predict raise ValueError( ValueError: Unexpected result of predict_function (Empty batch_outputs). Please use Model.compile(..., run_eagerly=True), or tf.config.run_functions_eagerly(True) for more information of where went wrong, or file a issue/bug to tf.keras.

That's the reason that i turn to preprocessing raw data.

Please give further suggestions.

By the way, if final predict include number zero,what's that mean?

Thanks & regards!

dicotom commented 1 month ago

In the data file: if self.mode == 'predict': test = values[len(dataset)-self.window_prev-1:len(dataset)-self.window_prev, :] # Keep it 2D

test = values[len(dataset)-self.window_prev-1, :]