2018-07-04 Python 常用错误解决方法

1、TypeError: can't multiply sequence by non-int of type 'float'

【python】算术运算报错can't multiply sequence by non-int of type 'float'

原因:input()函数输入的是字符串格式,所以自己在键盘输入的整数其实并不是正整数,而是字符串形式。所以在执行语句num3=num*num会报错。因为num1和num2都是字符串形式,不可以相乘。

解决思路:把num1和num2强制转换成整数

2、Warning (from warnings module):

  File "/usr/local/lib/python3.5/dist-packages/skimage/transform/_warps.py", line 105

    warn("The default mode, 'constant', will be changed to 'reflect' in "

UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15.

UserWarning: The default mode, 'constant', will be changed to 'reflect'

3、Warning (from warnings module):

  File "/usr/local/lib/python3.5/dist-packages/skimage/transform/_warps.py", line 110

    warn("Anti-aliasing will be enabled by default in skimage 0.15 to "

UserWarning: Anti-aliasing will be enabled by default in skimage 0.15 to avoid aliasing artifacts when down-sampling images.

【Mask R-CNN】(四):UserWarning: Anti-aliasing will be enabled by default in skimage 0.15的解决办法

sudo pip3 uninstall scikit-image

sudo pip3 install scikit-image==0.13.0

你可能感兴趣的:(2018-07-04 Python 常用错误解决方法)