I have encountered the following warning when running the standalone application on Python 3.8:
Code: Select all
-------------- run ResTriplet -------------------
deeppre.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import defaultdict, Iterable
Code: Select all
import torch
import torch.nn as nn
from torch.autograd import Variable
#from collections import defaultdict, Iterable # comment out original line
from collections import defaultdict ### add fix
from collections.abc import Iterable ### add fix
Another warning could significantly reduce performance and/or break the program, mentioned elsewhere in the forum:
Code: Select all
/home/khaled/programs/C-I-TASSER-1.0/contact/ResTriplet/aaweights.py:189: NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function "cal_large_matrix1" failed type inference due to: No implementation of function Function(<built-in function zeros>) found
for signature:
>>> zeros(list(int64)<iv=None>)
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'ol_np_zeros': File: numba/np/arrayobj.py: Line 4164.
With argument(s): '(list(int64)<iv=None>)':
Rejected as the implementation raised a specific error:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function empty>) found for signature:
>>> empty(list(int64)<iv=None>, dtype=Function(<class 'float'>))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'ol_np_empty': File: numba/np/arrayobj.py: Line 4086.
With argument(s): '(list(int64)<iv=None>, dtype=Function(<class 'float'>))':
Rejected as the implementation raised a specific error:
TypingError: Cannot parse input types to function np.empty(list(int64)<iv=None>, Function(<class 'float'>))
raised from /home/khaled/.local/lib/python3.8/site-packages/numba/np/arrayobj.py:4105
During: resolving callee type: Function(<built-in function empty>)
During: typing of call at /home/khaled/.local/lib/python3.8/site-packages/numba/np/arrayobj.py (4169)
File "../../../../.local/lib/python3.8/site-packages/numba/np/arrayobj.py", line 4169:
def impl(shape, dtype=float):
arr = np.empty(shape, dtype=dtype)
^
raised from /home/khaled/.local/lib/python3.8/site-packages/numba/core/typeinfer.py:1086
During: resolving callee type: Function(<built-in function zeros>)
During: typing of call at /home/khaled/programs/C-I-TASSER-1.0/contact/ResTriplet/aaweights.py (198)
Code: Select all
#cov=np.zeros([N*ALPHA,N*ALPHA ]) # comment out original line
cov=np.zeros((N*ALPHA,N*ALPHA)) ### add fix # replace the square brackets with parentheses
contact/TripletRes/aaweights.py
contact/ResPre/aaweights.py
contact/DeepPLM/aaweights.py
contact/ResPLM/aaweights.py
Quick one-liner to find and replace:
Code: Select all
grep -rlP '\(\[N\*ALPHA\,N\*ALPHA \]\)' --include='*py' | xargs sed -i 's/\(\[N\*ALPHA\,N\*ALPHA \]\)/((N*ALPHA,N*ALPHA))/g'
My setup:
Code: Select all
Python 3.8.10
Package Version
------------------------ --------------------
biopython 1.76
Cython 0.29.32
numba 0.56.4
numpy 1.22.2
scikit-learn 1.1.3
scipy 1.9.3
six 1.14.0
torch 1.13.0