Closed kobrata6 closed 4 years ago
Did you change anything in prepare data?
Also, you have to make sure you are using python 3. Python 2 doesn't support 'with' I believe.
Did you change anything in prepare data?
Yes, at the line
# Output file handler out_file = open('{}{}'.format(preprocessing['train_folder'], file_name), 'w', encoding='utf-8', buffering=131072)
I removed ""encoding='utf-8', because in the terminal I am getting error
Preparing training set from raw set File: tst2012.to Traceback (most recent call last): File "prepare_data.py", line 565, in <module> prepare() File "prepare_data.py", line 65, in prepare out_file = open('{}{}'.format(preprocessing['train_folder'], file_name), 'w', encoding='utf-8', buffering=131072) TypeError: file() takes at most 3 arguments (4 given)
Okay I run the file using Python3 (thanks for that mate) and I got new error:
Preparing training set from raw set File: train.from Traceback (most recent call last): File "prepare_data.py", line 565, in <module> prepare() File "prepare_data.py", line 80, in prepare number_of_records = min(amount, sum(1 for _ in open_function(source_file_name, 'rt', encoding='utf-8', **additioan_params))) UnboundLocalError: local variable 'open_function' referenced before assignment
What should i do?
I'd start up a VM and install everything from scratch if I were you.
I'd start up a VM and install everything from scratch if I were you.
That is what I did and here I am
This is the code I receive in the terminal
This is lane 77:
with Pool(processes=preprocessing['cpu_count']) as pool: