Gradient has outdated direction syntax. New syntax is like `to left` instead of `right`.

17 篇文章 0 订阅
11 篇文章 0 订阅

 当Vue  引用CSS 会提示以下错误:  语法过时。。。。。

 Gradient has outdated direction syntax. New syntax is like `to left` instead of `right`.

并随之带有 一堆 css-loader  路径

Failed to compile.

./src/assets/css/button.css (./node_modules/_css-loader@3.2.0@css-loader/dist/cjs.js??ref--10-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/_postcss-loader@3.0.0@postcss-loader/src??ref--10-oneOf-1-2!./src/assets/css/button.css) Module Warning (from ./node_modules/_postcss-loader@3.0.0@postcss-loader/src/index.js):

警告:Gradient has outdated direction syntax. New syntax is like `to left` instead of `right`.

1. 语法过时示例:

.button-raised {
  border-color: #e1e1e1;
  border-style: solid;
  border-width: 1px;
  line-height: 38px;
  background: -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e1e1e1));
  background: linear-gradient(#f6f6f6, #e1e1e1);
  -webkit-box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15);
  box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15);
}

.button-raised:hover,
.button-raised:focus {
  background: -webkit-gradient(linear, left top, left bottom, from(white), to(gainsboro));
  background: linear-gradient(to top, white, gainsboro);
}

2. 解决方法 

把上面CSS 中的  

-webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e1e1e1));

改成:

 background: -webkit-gradient(linear, to left to top, to left bottom, from(#f6f6f6), to(#e1e1e1));

把所有的 类似语法 中的 left , top   改为 to left , to top 。  vue  就不再有警告提示了

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这句话的意思是,计算损失函数相对于输入图像像素的梯度。在深度学习中,通常将输入图像视为模型的输入,然后通过反向传播算法计算损失函数相对于输入图像的梯度,以优化模型的参数或输入。这种方法通常被称为“反向传播梯度”。 具体来说,在计算图像梯度时,我们需要先定义一个损失函数,然后使用 `GradientTape` 计算损失函数相对于输入图像的梯度。例如,在计算图像的梯度下降时,可以使用以下代码: ``` import tensorflow as tf img = tf.Variable(tf.ones([1, 224, 224, 3])) # 定义输入图像变量 model = tf.keras.applications.MobileNetV2() # 定义模型 loss_object = tf.keras.losses.CategoricalCrossentropy() # 定义损失函数 with tf.GradientTape() as tape: # 计算模型的输出和损失函数 predictions = model(img) loss = loss_object(y_true, predictions) # 计算损失函数相对于输入图像的梯度 grads = tape.gradient(loss, img) # 使用梯度下降更新输入图像 img.assign_sub(lr * grads) ``` 在上面的代码中,我们定义了一个输入图像变量 `img`、一个模型 `model` 以及一个损失函数 `loss_object`。然后,我们使用 `GradientTape` 计算损失函数相对于输入图像的梯度,并使用梯度下降算法更新输入图像以最小化损失函数。在计算梯度时,我们将损失函数 `loss` 和输入图像变量 `img` 作为参数传递给 `tape.gradient()` 函数,以计算损失函数相对于输入图像的梯度。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值