ucasir / NPRF

NPRF: A Neural Pseudo Relevance Feedback Framework for Ad-hoc Information Retrieval
Apache License 2.0
32 stars 10 forks source link

SyntaxError: invalid syntax #5

Closed minhson-kaist closed 5 years ago

minhson-kaist commented 5 years ago

When I tried to run ./runfold.sh, it raised the error: except ValueError, e: ^ SyntaxError: invalid syntax

Did it do any bad influence on running the code?

Thanks,

canjiali commented 5 years ago

We don't encounter this problem. It seems that the error comes from the python script, can you paste all the outputs from your terminal?

minhson-kaist commented 5 years ago
/home/shawn/anaconda3/envs/ir_prf/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Traceback (most recent call last):
  File "nprf_drmm.py", line 28, in <module>
    from file_operation import write_result_to_trec_format, load_pickle, retain_file
  File "../utils/file_operation.py", line 141
    except ValueError, e:
                     ^
SyntaxError: invalid syntax

here is the script

canjiali commented 5 years ago

You are using python3. However, only python2 is supported in this project. Nevertheless, you can modify the code to make it run in python3. For example, your error occurs since "except ValueError, e" is a wrong expression in python3, you can simply modify it to "except ValueError as e". Hope that helps.