安装软件时,我的终端收到了一条消息: You are using pip version 8.1.1, however version 10.0.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
所以我升级了pip版本: $ pip install --upgrade pip
现在我收到此错误:
~$ pip install ipython
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
Run Code Online (Sandbox Code Playgroud) 当我在Ubuntu 16.04中键入以下命令时
$ pip install mysqlclient
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
`enter code here`Collecting mysqlclient
Downloading https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz (89kB)
100% |????????????????????????????????| 92kB 136kB/s
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-fs0wmmw4/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-install-fs0wmmw4/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-install-fs0wmmw4/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py …Run Code Online (Sandbox Code Playgroud) 根据Keras的骰子系数损失函数的实现,损失为骰子系数计算值的负值。损失应该随着时期的减少而减少,但是通过这种实现,我自然会总是得到负损失,并且损失随着时期的减少而减少,即从0移向负无穷大,而不是接近于0。如果我使用(1-骰子co-eff)而不是(-dice co-eff)作为损失,这是错误的吗? 这是完整的Keras实现(我正在谈论):https : //github.com/jocicmarko/ultrasound-nerve-segmentation/blob/master/train.py
smooth = 1.
def dice_coef(y_true, y_pred):
y_true_f = K.flatten(y_true)
y_pred_f = K.flatten(y_pred)
intersection = K.sum(y_true_f * y_pred_f)
return (2. * intersection + smooth) / (K.sum(y_true_f) + K.sum(y_pred_f) + smooth)
def dice_coef_loss(y_true, y_pred):
return -dice_coef(y_true, y_pred)
Run Code Online (Sandbox Code Playgroud)
我已经与您分享了我的实验日志,尽管仅记录了2个纪元:
Train on 2001 samples, validate on 501 samples
Epoch 1/2
Epoch 00001: loss improved from inf to -0.73789, saving model to unet.hdf5
- 3229s - loss: -7.3789e-01 - dice_coef: 0.7379 - val_loss: -7.9304e-01 - val_dice_coef: 0.7930
Epoch …Run Code Online (Sandbox Code Playgroud)