facebookresearch / SymbolicMathematics

Deep Learning for Symbolic Mathematics
Other
523 stars 114 forks source link

AssertionError #3

Open quantitative-technologies opened 4 years ago

quantitative-technologies commented 4 years ago

Trying to use this the first time:

$ python main.py --export_data true

SLURM job: False 0 - Number of nodes: 1 0 - Node ID : 0 0 - Local rank : 0 0 - Global rank : 0 0 - World size : 1 0 - GPUs per node : 1 0 - Master : True 0 - Multi-node : False 0 - Multi-GPU : False 0 - Hostname : james-Bonobo-WS INFO - 04/18/20 15:18:46 - 0:00:00 - ============ Initialized logger ============ INFO - 04/18/20 15:18:46 - 0:00:00 - accumulate_gradients: 1 amp: -1 attention_dropout: 0 balanced: False batch_size: 32 beam_early_stopping: True beam_eval: False beam_length_penalty: 1 beam_size: 1 clean_prefix_expr: True clip_grad_norm: 5 command: python main.py --export_data true --exp_id "imf0l5hfpl" cpu: False debug: False debug_slurm: False dropout: 0 dump_path: ./dumped/debug/imf0l5hfpl emb_dim: 256 env_base_seed: 0 env_name: char_sp epoch_size: 300000 eval_only: False eval_verbose: 0 eval_verbose_print: False exp_id: imf0l5hfpl exp_name: debug export_data: True fp16: False global_rank: 0 int_base: 10 is_master: True is_slurm_job: False leaf_probs: 0.75,0,0.25,0
local_rank: 0
master_port: -1
max_epoch: 100000
max_int: 10000
max_len: 512
max_ops: 10 max_ops_G: 4 multi_gpu: False multi_node: False n_coefficients: 0 n_dec_layers: 4 n_enc_layers: 4 n_gpu_per_node: 1 n_heads: 4 n_nodes: 1 n_variables: 1 node_id: 0 num_workers: 10 operators: add:2,sub:1 optimizer: adam,lr=0.0001 positive: False precision: 10 reload_checkpoint: reload_data: reload_model:
reload_size: -1 rewrite_functions: same_nb_ops_per_batch: False save_periodic: 0 share_inout_emb: True sinusoidal_embeddings: False stopping_criterion: tasks: validation_metrics: world_size: 1 INFO - 04/18/20 15:18:46 - 0:00:00 - The experiment will be stored in ./dumped/debug/imf0l5hfpl

INFO - 04/18/20 15:18:46 - 0:00:00 - Running command: python main.py --export_data true

WARNING - 04/18/20 15:18:46 - 0:00:00 - Signal handler installed. INFO - 04/18/20 15:18:46 - 0:00:00 - Unary operators: [] INFO - 04/18/20 15:18:46 - 0:00:00 - Binary operators: ['add', 'sub'] INFO - 04/18/20 15:18:46 - 0:00:00 - words: {'': 0, '': 1, '': 2, '(': 3, ')': 4, '': 5, '': 6, '': 7, '': 8, '': 9, 'pi': 10, 'E': 11, ' x': 12, 'y': 13, 'z': 14, 't': 15, 'a0': 16, 'a1': 17, 'a2': 18, 'a3': 19, 'a4': 20, 'a5': 21, 'a6': 22, 'a7': 23, 'a8': 24, 'a9': 25, 'abs': 26, 'acos': 27, 'acosh': 28, 'acot': 29, 'acoth': 30, 'acsc': 31, 'acsch': 32, 'add': 33, 'asec': 34, 'asech': 35, 'asin': 36, 'asinh': 37, 'atan': 38, 'atanh': 39, 'cos': 40, 'cosh': 41, 'cot': 42, 'coth': 43, 'csc': 44, 'csch': 45, 'derivative': 46, 'div': 47, 'ex p': 48, 'f': 49, 'g': 50, 'h': 51, 'inv': 52, 'ln': 53, 'mul': 54, 'pow': 55, 'pow2': 56, 'pow3': 57, 'pow4': 58, 'pow5': 59, 'rac': 60, 'sec': 61, 'sech': 62, 'sign': 63, 'sin': 64, 'sinh': 65, 'sqrt': 6 6, 'sub': 67, 'tan': 68, 'tanh': 69, 'I': 70, 'INT+': 71, 'INT-': 72, 'INT': 73, 'FLOAT': 74, '-': 75, '.': 76, '10^': 77, 'Y': 78, "Y'": 79, "Y''": 80, '0': 81, '1': 82, '2': 83, '3': 84, '4': 85, '5': 8 6, '6': 87, '7': 88, '8': 89, '9': 90} INFO - 04/18/20 15:18:46 - 0:00:00 - 20001 possible leaves. INFO - 04/18/20 15:18:46 - 0:00:00 - Checking expressions in [0.01, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 2.1, 3.1, -0.01, -0.1, -0.3, -0.5, -0.7, -0.9, -1.1, -2.1, -3.1] Traceback (most recent call last): File "main.py", line 232, in main(params) File "main.py", line 167, in main env = build_env(params) File "/home/james/Data Science/SymbolicMathematics/src/envs/init.py", line 29, in build_env assert len(tasks) == len(set(tasks)) > 0 AssertionError

quantitative-technologies commented 4 years ago

OK. It seems that the default of no tasks will throw an error.

I can add a pull request giving an informative error message in case that is of any interest.

glample commented 4 years ago

Ah yes sorry, I guess this error could be a bit more explicit. You will indeed have an error if no task is provided.