twopin / CAMP

predicting peptide-protein interactions
117 stars 30 forks source link

predict with example code use the test data #7

Closed leavdragon closed 2 years ago

leavdragon commented 2 years ago

Hi, I predict with example code and use the test data with the command 'python -u predict_CAMP.py'. However, the following error is indicated. ‘File "predict_CAMP.py", line 178, in X_pep, X_p, X_SS_pep, X_SS_p, X_2_pep, X_2_p, X_dense_pep, X_dense_p, pep_sequence, prot_sequence = load_example(model_mode) File "predict_CAMP.py", line 82, in load_example protein_feature_dict = pickle.load(f) TypeError: a bytes-like object is required, not 'str' ’

Am I using the features in ‘example_data_feature’ incorrectly, or is there a problem with the file format somewhere? I look forward to and appreciate your answer.

twopin commented 2 years ago

Hi, I think the reason might be that the feature dict you want to load in not pickled under the same version of python. In Python 3 you need to specifically call either 'rb' or 'wb'.