doas3140 / PyStack

Python implementation of Deepstack
79 stars 34 forks source link

RuntimeWarning: invalid value encountered in true_divide out.children_cfvs /= scaler #7

Open jidma opened 3 years ago

jidma commented 3 years ago

When running data generation:

python generate_data.py --street 4 --approximate root_nodes

I encounter the following warning:

100%|█████████████████████████████████████████████████████████████████████████| 300/300 [00:26<00:00, 11.12it/s]
WARNING: THERE ARE NO NODES THAT NEEDS APPROXIMATION (lookahead.cfvs_approximator is not defined)
/xxxxxx/PyStack/src/Lookahead/lookahead.py:88: RuntimeWarning: invalid value encountered in true_divide
   out.children_cfvs /= scaler
took:27.06342339515686
100%|█████████████████████████████████████████████████████████████████████████| 300/300 [09:40<00:00,  1.94s/it]
WARNING: THERE ARE NO NODES THAT NEEDS APPROXIMATION (lookahead.cfvs_approximator is not defined)
took:581.3314623832703

It ends up generating the following files:

./TrainSamples/river/root_nodes_npy/targets.0.npy
./TrainSamples/river/root_nodes_npy/boards.0.npy
./TrainSamples/river/root_nodes_npy/inputs.0.npy

When I run the training:

python train_nn.py --street 4 --approximate root_nodes

It throws the error:

COMPILING MODEL...
Traceback (most recent call last):
  File "train_nn.py", line 38, in <module>
    main()
  File "train_nn.py", line 34, in main
    T = Train(data_dir_list=data_dirs, street=street)
  File "/xxxx/PyStack/src/NnTraining/train.py", line 32, in __init__
    self.tfrecords = [f.path for dirpath in data_dir_list for f in os.scandir(dirpath)]
  File "/xxxx/PyStack/src/NnTraining/train.py", line 32, in <listcomp>
    self.tfrecords = [f.path for dirpath in data_dir_list for f in os.scandir(dirpath)]
FileNotFoundError: [Errno 2] No such file or directory: '/xxxxx/PyStack/Data/TrainSamples/river/root_nodes_tfrecords'

PS: In arguments.py I have set :

# TF RECORDS
self.tfrecords_batch_size = 64 # 1024*10 # ~200MB

Using : tensorflow-gpu==1.13.1

LizChen2000 commented 3 years ago

@doas3140 I have the same question!!!Can u help me

XinWang0219 commented 1 year ago

@LizChen2000 @jidma. I think it may be because you run training directly after generating data. you miss the step to convert to tf data. Pay attention to the steps of the pseudo-code.