Conv2DSlowBackpropInput:输入深度必须可以被过滤器深度均匀除尽

时间:2019-12-30 15:01:02

标签: python tensorflow lambda keras conv-neural-network

此代码不起作用(标题出现错误):

package servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.tomcat.util.http.parser.Cookie;

public class SqServlets extends HttpServlet {

    public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException {

        int k=0;
        Cookie cookie[]= req.getCookies();

        k=k*k;

        PrintWriter out=res.getWriter();
        out.print("square value is = "+k);

    }


}

此代码确实有效:

def conv1d_transpose(x, filters, kernel_width=25, stride=4):
    inp = K.expand_dims(x, axis=1)
    return Conv2DTranspose(
        filters,
        (1, kernel_width),
        strides=(1, stride),
        padding='same'
        )(inp)[:, 0]
deconv_layer0 = Lambda(lambda x: conv1d_transpose(x, c*d))(relu_layer0)

为什么不呢?他们俩都做不到同一件事吗?

0 个答案:

没有答案