google-deepmind / mathematics_dataset

This dataset code generates mathematical question and answer pairs, from a range of question types at roughly school-level difficulty.
Apache License 2.0
1.8k stars 249 forks source link

Problem generating examples #12

Closed yvargasp1 closed 4 years ago

yvargasp1 commented 4 years ago

issue

Can you help me , with this problem ? .

yvargasp1 commented 4 years ago

I run the command at the anaconda prompt: "python -m mathematics_dataset.generate --filter = linear_1d" and "python -m mathematics_dataset.generate_to_file --output_drir = '..', and the second just create the empty file without any data" .

akpandeya commented 4 years ago

np.int32 is not recognized as integer. Please change the two files and it would do the job.

  1. mathematics_dataset\mathematics_dataset\sample\number.py Line number 144 becomes : return isinstance(value, (int, np.int64, np.int32, sympy.Integer)) Like this: change 1

  2. mathematics_dataset\mathematics_dataset\sample\ops.py Add another line below line 205 such that line 202-207 become:

    elif (isinstance(self._value, int) or isinstance(self._value, sympy.Integer) or isinstance(self._value, display.Decimal) or isinstance(self._value, np.int64) or isinstance(self._value, np.int32)): return self._value >= 0 Like this: change 2

akpandeya commented 4 years ago

Or you could clone my forked version: https://github.com/akpandeya/mathematics_dataset

davidsaxton commented 4 years ago

Thanks Avanindra for the PR!