model

本文介绍了一个基于Java的登录模块的设计与实现过程,包括接口定义、数据交互方式及使用OkHttp进行网络请求的具体实现。
package com.bwie.weishang.login.model;

import com.bwie.weishang.login.bean.User;

/**
 * author: Wangxinrun
 * Date: 2017/12/7
 * Time: 19:59
 */

public interface Imodel {
    void login(User user);

}

public interface Smodel {     void sudoku(); }

package com.bwie.weishang.login.model;

import com.bwie.weishang.login.bean.User;
import com.bwie.weishang.login.bean.UserBean;
import com.bwie.weishang.tools.Api;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import okhttp3.Call;
import utils.GsonObjectCallback;
import utils.OkHttp3Utils;

/**
 * author: Wangxinrun
 * Date: 2017/12/7
 * Time: 20:02
 */

public class UserModle implements Imodel{


    // 定义接口变量
    private OnFinishLisenter lisenter;

    //定义接口
    public interface OnFinishLisenter{
        void onFinish(UserBean userBean);
    }
    public void setOnFinishLisenter(OnFinishLisenter lisenter){
        this.lisenter = lisenter;
    }

    @Override
    public void login(User user) {
        Map<String,String> map=new HashMap<>();
        map.put("mobile",user.getName());
        map.put("password",user.getPass());

        OkHttp3Utils.doPost(Api.LOGIN, map, new GsonObjectCallback<UserBean>() {
            @Override
            public void onUi(UserBean userBean) {
                if(lisenter!=null){
                    lisenter.onFinish(userBean);
                }
            }

            @Override
            public void onFailed(Call call, IOException e) {

            }
        });
    }
}
------------------------------------------------

public class SUsermodel implements Smodel{
    // 定义接口变量
    private OnFinishLisenter lisenter;
    //定义接口
    public interface OnFinishLisenter{
        void onFinish(Sudoku sudoku);
    }
    public void setOnFinishLisenter(OnFinishLisenter lisenter){
        this.lisenter = lisenter;
    }




    @Override
    public void sudoku() {
        OkHttp3Utils.doGet("http://120.27.23.105/product/getCatagory", new GsonObjectCallback<Sudoku>() {
            @Override
            public void onUi(Sudoku sudoku) {
                if(lisenter!=null){
                    lisenter.onFinish(sudoku);
                }
            }


            @Override
            public void onFailed(Call call, IOException e) {


            }
        });
    }
}

raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for YOLO: Missing key(s) in state_dict: "model.model.0.conv.weight", "model.model.0.bn.weight", "model.model.0.bn.bias", "model.model.0.bn.running_mean", "model.model.0.bn.running_var", "model.model.1.conv.weight", "model.model.1.bn.weight", "model.model.1.bn.bias", "model.model.1.bn.running_mean", "model.model.1.bn.running_var", "model.model.2.cv1.conv.weight", "model.model.2.cv1.bn.weight", "model.model.2.cv1.bn.bias", "model.model.2.cv1.bn.running_mean", "model.model.2.cv1.bn.running_var", "model.model.2.cv2.conv.weight", "model.model.2.cv2.bn.weight", "model.model.2.cv2.bn.bias", "model.model.2.cv2.bn.running_mean", "model.model.2.cv2.bn.running_var", "model.model.2.m.0.cv1.conv.weight", "model.model.2.m.0.cv1.bn.weight", "model.model.2.m.0.cv1.bn.bias", "model.model.2.m.0.cv1.bn.running_mean", "model.model.2.m.0.cv1.bn.running_var", "model.model.2.m.0.cv2.conv.weight", "model.model.2.m.0.cv2.bn.weight", "model.model.2.m.0.cv2.bn.bias", "model.model.2.m.0.cv2.bn.running_mean", "model.model.2.m.0.cv2.bn.running_var", "model.model.3.conv.weight", "model.model.3.bn.weight", "model.model.3.bn.bias", "model.model.3.bn.running_mean", "model.model.3.bn.running_var", "model.model.4.cv1.conv.weight", "model.model.4.cv1.bn.weight", "model.model.4.cv1.bn.bias", "model.model.4.cv1.bn.running_mean", "model.model.4.cv1.bn.running_var", "model.model.4.cv2.conv.weight", "model.model.4.cv2.bn.weight", "model.model.4.cv2.bn.bias", "model.model.4.cv2.bn.running_mean", "model.model.4.cv2.bn.running_var", "model.model.4.m.0.cv1.conv.weight", "model.model.4.m.0.cv1.bn.weight", "model.model.4.m.0.cv1.bn.bias", "model.model.4.m.0.cv1.bn.running_mean", "model.model.4.m.0.cv1.bn.running_var", "model.model.4.m.0.cv2.conv.weight", "model.model.4.m.0.cv2.bn.weight", "model.model.4.m.0.cv2.bn.bias", "model.model.4.m.0.cv2.bn.running_mean", "model.model.4.m.0.cv2.bn.running_var", "model.model.5.conv.weight", "model.model.5.bn.weight", "model.model.5.bn.bias", "model.model.5.bn.running_mean", "model.model.5.bn.running_var", "model.model.6.cv1.conv.weight", "model.model.6.cv1.bn.weight", "model.model.6.cv1.bn.bias", "model.model.6.cv1.bn.running_mean", "model.model.6.cv1.bn.running_var", "model.model.6.cv2.conv.weight", "model.model.6.cv2.bn.weight", "model.model.6.cv2.bn.bias", "model.model.6.cv2.bn.running_mean", "model.model.6.cv2.bn.running_var", "model.model.6.m.0.cv1.conv.weight", "model.model.6.m.0.cv1.bn.weight", "model.model.6.m.0.cv1.bn.bias", "model.model.6.m.0.cv1.bn.running_mean", "model.model.6.m.0.cv1.bn.running_var", "model.model.6.m.0.cv2.conv.weight", "model.model.6.m.0.cv2.bn.weight", "model.model.6.m.0.cv2.bn.bias", "model.model.6.m.0.cv2.bn.running_mean", "model.model.6.m.0.cv2.bn.running_var", "model.model.6.m.0.cv3.conv.weight", "model.model.6.m.0.cv3.bn.weight", "model.model.6.m.0.cv3.bn.bias", "model.model.6.m.0.cv3.bn.running_mean", "model.model.6.m.0.cv3.bn.running_var", "model.model.6.m.0.m.0.cv1.conv.weight", "model.model.6.m.0.m.0.cv1.bn.weight", "model.model.6.m.0.m.0.cv1.bn.bias", "model.model.6.m.0.m.0.cv1.bn.running_mean", "model.model.6.m.0.m.0.cv1.bn.running_var", "model.model.6.m.0.m.0.cv2.conv.weight", "model.model.6.m.0.m.0.cv2.bn.weight", "model.model.6.m.0.m.0.cv2.bn.bias", "model.model.6.m.0.m.0.cv2.bn.running_mean", "model.model.6.m.0.m.0.cv2.bn.running_var", "model.model.6.m.0.m.1.cv1.conv.weight", "model.model.6.m.0.m.1.cv1.bn.weight", "model.model.6.m.0.m.1.cv1.bn.bias", "model.model.6.m.0.m.1.cv1.bn.running_mean", "model.model.6.m.0.m.1.cv1.bn.running_var", "model.model.6.m.0.m.1.cv2.conv.weight", "model.model.6.m.0.m.1.cv2.bn.weight", "model.model.6.m.0.m.1.cv2.bn.bias", "model.model.6.m.0.m.1.cv2.bn.running_mean", "model.model.6.m.0.m.1.cv2.bn.running_var", "model.model.7.conv.weight", "model.model.7.bn.weight", "model.model.7.bn.bias", "model.model.7.bn.running_mean", "model.model.7.bn.running_var", "model.model.8.cv1.conv.weight", "model.model.8.cv1.bn.weight", "model.model.8.cv1.bn.bias", "model.model.8.cv1.bn.running_mean", "model.model.8.cv1.bn.running_var", "model.model.8.cv2.conv.weight", "model.model.8.cv2.bn.weight", "model.model.8.cv2.bn.bias", "model.model.8.cv2.bn.running_mean", "model.model.8.cv2.bn.running_var", "model.model.8.m.0.cv1.conv.weight", "model.model.8.m.0.cv1.bn.weight", "model.model.8.m.0.cv1.bn.bias", "model.model.8.m.0.cv1.bn.running_mean", "model.model.8.m.0.cv1.bn.running_var", "model.model.8.m.0.cv2.conv.weight", "model.model.8.m.0.cv2.bn.weight", "model.model.8.m.0.cv2.bn.bias", "model.model.8.m.0.cv2.bn.running_mean", "model.model.8.m.0.cv2.bn.running_var", "model.model.8.m.0.cv3.conv.weight", "model.model.8.m.0.cv3.bn.weight", "model.model.8.m.0.cv3.bn.bias", "model.model.8.m.0.cv3.bn.running_mean", "model.model.8.m.0.cv3.bn.running_var", "model.model.8.m.0.m.0.cv1.conv.weight", "model.model.8.m.0.m.0.cv1.bn.weight", "model.model.8.m.0.m.0.cv1.bn.bias", "model.model.8.m.0.m.0.cv1.bn.running_mean", "model.model.8.m.0.m.0.cv1.bn.running_var", "model.model.8.m.0.m.0.cv2.conv.weight", "model.model.8.m.0.m.0.cv2.bn.weight", "model.model.8.m.0.m.0.cv2.bn.bias", "model.model.8.m.0.m.0.cv2.bn.running_mean", "model.model.8.m.0.m.0.cv2.bn.running_var", "model.model.8.m.0.m.1.cv1.conv.weight", "model.model.8.m.0.m.1.cv1.bn.weight", "model.model.8.m.0.m.1.cv1.bn.bias", "model.model.8.m.0.m.1.cv1.bn.running_mean", "model.model.8.m.0.m.1.cv1.bn.running_var", "model.model.8.m.0.m.1.cv2.conv.weight", "model.model.8.m.0.m.1.cv2.bn.weight", "model.model.8.m.0.m.1.cv2.bn.bias", "model.model.8.m.0.m.1.cv2.bn.running_mean", "model.model.8.m.0.m.1.cv2.bn.running_var", "model.model.9.cv1.conv.weight", "model.model.9.cv1.bn.weight", "model.model.9.cv1.bn.bias", "model.model.9.cv1.bn.running_mean", "model.model.9.cv1.bn.running_var", "model.model.9.cv2.conv.weight", "model.model.9.cv2.bn.weight", "model.model.9.cv2.bn.bias", "model.model.9.cv2.bn.running_mean", "model.model.9.cv2.bn.running_var", "model.model.10.cv1.conv.weight", "model.model.10.cv1.bn.weight", "model.model.10.cv1.bn.bias", "model.model.10.cv1.bn.running_mean", "model.model.10.cv1.bn.running_var", "model.model.10.cv2.conv.weight", "model.model.10.cv2.bn.weight", "model.model.10.cv2.bn.bias", "model.model.10.cv2.bn.running_mean", "model.model.10.cv2.bn.running_var", "model.model.10.m.0.attn.qkv.conv.weight", "model.model.10.m.0.attn.qkv.bn.weight", "model.model.10.m.0.attn.qkv.bn.bias", "model.model.10.m.0.attn.qkv.bn.running_mean", "model.model.10.m.0.attn.qkv.bn.running_var", "model.model.10.m.0.attn.proj.conv.weight", "model.model.10.m.0.attn.proj.bn.weight", "model.model.10.m.0.attn.proj.bn.bias", "model.model.10.m.0.attn.proj.bn.running_mean", "model.model.10.m.0.attn.proj.bn.running_var", "model.model.10.m.0.attn.pe.conv.weight", "model.model.10.m.0.attn.pe.bn.weight", "model.model.10.m.0.attn.pe.bn.bias", "model.model.10.m.0.attn.pe.bn.running_mean", "model.model.10.m.0.attn.pe.bn.running_var", "model.model.10.m.0.ffn.0.conv.weight", "model.model.10.m.0.ffn.0.bn.weight", "model.model.10.m.0.ffn.0.bn.bias", "model.model.10.m.0.ffn.0.bn.running_mean", "model.model.10.m.0.ffn.0.bn.running_var", "model.model.10.m.0.ffn.1.conv.weight", "model.model.10.m.0.ffn.1.bn.weight", "model.model.10.m.0.ffn.1.bn.bias", "model.model.10.m.0.ffn.1.bn.running_mean", "model.model.10.m.0.ffn.1.bn.running_var", "model.model.13.cv1.conv.weight", "model.model.13.cv1.bn.weight", "model.model.13.cv1.bn.bias", "model.model.13.cv1.bn.running_mean", "model.model.13.cv1.bn.running_var", "model.model.13.cv2.conv.weight", "model.model.13.cv2.bn.weight", "model.model.13.cv2.bn.bias", "model.model.13.cv2.bn.running_mean", "model.model.13.cv2.bn.running_var", "model.model.13.m.0.cv1.conv.weight", "model.model.13.m.0.cv1.bn.weight", "model.model.13.m.0.cv1.bn.bias", "model.model.13.m.0.cv1.bn.running_mean", "model.model.13.m.0.cv1.bn.running_var", "model.model.13.m.0.cv2.conv.weight", "model.model.13.m.0.cv2.bn.weight", "model.model.13.m.0.cv2.bn.bias", "model.model.13.m.0.cv2.bn.running_mean", "model.model.13.m.0.cv2.bn.running_var", "model.model.16.cv1.conv.weight", "model.model.16.cv1.bn.weight", "model.model.16.cv1.bn.bias", "model.model.16.cv1.bn.running_mean", "model.model.16.cv1.bn.running_var", "model.model.16.cv2.conv.weight", "model.model.16.cv2.bn.weight", "model.model.16.cv2.bn.bias", "model.model.16.cv2.bn.running_mean", "model.model.16.cv2.bn.running_var", "model.model.16.m.0.cv1.conv.weight", "model.model.16.m.0.cv1.bn.weight", "model.model.16.m.0.cv1.bn.bias", "model.model.16.m.0.cv1.bn.running_mean", "model.model.16.m.0.cv1.bn.running_var", "model.model.16.m.0.cv2.conv.weight", "model.model.16.m.0.cv2.bn.weight", "model.model.16.m.0.cv2.bn.bias", "model.model.16.m.0.cv2.bn.running_mean", "model.model.16.m.0.cv2.bn.running_var", "model.model.17.conv.weight", "model.model.17.bn.weight", "model.model.17.bn.bias", "model.model.17.bn.running_mean", "model.model.17.bn.running_var", "model.model.19.cv1.conv.weight", "model.model.19.cv1.bn.weight", "model.model.19.cv1.bn.bias", "model.model.19.cv1.bn.running_mean", "model.model.19.cv1.bn.running_var", "model.model.19.cv2.conv.weight", "model.model.19.cv2.bn.weight", "model.model.19.cv2.bn.bias", "model.model.19.cv2.bn.running_mean", "model.model.19.cv2.bn.running_var", "model.model.19.m.0.cv1.conv.weight", "model.model.19.m.0.cv1.bn.weight", "model.model.19.m.0.cv1.bn.bias", "model.model.19.m.0.cv1.bn.running_mean", "model.model.19.m.0.cv1.bn.running_var", "model.model.19.m.0.cv2.conv.weight", "model.model.19.m.0.cv2.bn.weight", "model.model.19.m.0.cv2.bn.bias", "model.model.19.m.0.cv2.bn.running_mean", "model.model.19.m.0.cv2.bn.running_var", "model.model.20.conv.weight", "model.model.20.bn.weight", "model.model.20.bn.bias", "model.model.20.bn.running_mean", "model.model.20.bn.running_var", "model.model.22.cv1.conv.weight", "model.model.22.cv1.bn.weight", "model.model.22.cv1.bn.bias", "model.model.22.cv1.bn.running_mean", "model.model.22.cv1.bn.running_var", "model.model.22.cv2.conv.weight", "model.model.22.cv2.bn.weight", "model.model.22.cv2.bn.bias", "model.model.22.cv2.bn.running_mean", "model.model.22.cv2.bn.running_var", "model.model.22.m.0.cv1.conv.weight", "model.model.22.m.0.cv1.bn.weight", "model.model.22.m.0.cv1.bn.bias", "model.model.22.m.0.cv1.bn.running_mean", "model.model.22.m.0.cv1.bn.running_var", "model.model.22.m.0.cv2.conv.weight", "model.model.22.m.0.cv2.bn.weight", "model.model.22.m.0.cv2.bn.bias", "model.model.22.m.0.cv2.bn.running_mean", "model.model.22.m.0.cv2.bn.running_var", "model.model.22.m.0.cv3.conv.weight", "model.model.22.m.0.cv3.bn.weight", "model.model.22.m.0.cv3.bn.bias", "model.model.22.m.0.cv3.bn.running_mean", "model.model.22.m.0.cv3.bn.running_var", "model.model.22.m.0.m.0.cv1.conv.weight", "model.model.22.m.0.m.0.cv1.bn.weight", "model.model.22.m.0.m.0.cv1.bn.bias", "model.model.22.m.0.m.0.cv1.bn.running_mean", "model.model.22.m.0.m.0.cv1.bn.running_var", "model.model.22.m.0.m.0.cv2.conv.weight", "model.model.22.m.0.m.0.cv2.bn.weight", "model.model.22.m.0.m.0.cv2.bn.bias", "model.model.22.m.0.m.0.cv2.bn.running_mean", "model.model.22.m.0.m.0.cv2.bn.running_var", "model.model.22.m.0.m.1.cv1.conv.weight", "model.model.22.m.0.m.1.cv1.bn.weight", "model.model.22.m.0.m.1.cv1.bn.bias", "model.model.22.m.0.m.1.cv1.bn.running_mean", "model.model.22.m.0.m.1.cv1.bn.running_var", "model.model.22.m.0.m.1.cv2.conv.weight", "model.model.22.m.0.m.1.cv2.bn.weight", "model.model.22.m.0.m.1.cv2.bn.bias", "model.model.22.m.0.m.1.cv2.bn.running_mean", "model.model.22.m.0.m.1.cv2.bn.running_var", "model.model.23.cv2.0.0.conv.weight", "model.model.23.cv2.0.0.bn.weight", "model.model.23.cv2.0.0.bn.bias", "model.model.23.cv2.0.0.bn.running_mean", "model.model.23.cv2.0.0.bn.running_var", "model.model.23.cv2.0.1.conv.weight", "model.model.23.cv2.0.1.bn.weight", "model.model.23.cv2.0.1.bn.bias", "model.model.23.cv2.0.1.bn.running_mean", "model.model.23.cv2.0.1.bn.running_var", "model.model.23.cv2.0.2.weight", "model.model.23.cv2.0.2.bias", "model.model.23.cv2.1.0.conv.weight", "model.model.23.cv2.1.0.bn.weight", "model.model.23.cv2.1.0.bn.bias", "model.model.23.cv2.1.0.bn.running_mean", "model.model.23.cv2.1.0.bn.running_var", "model.model.23.cv2.1.1.conv.weight", "model.model.23.cv2.1.1.bn.weight", "model.model.23.cv2.1.1.bn.bias", "model.model.23.cv2.1.1.bn.running_mean", "model.model.23.cv2.1.1.bn.running_var", "model.model.23.cv2.1.2.weight", "model.model.23.cv2.1.2.bias", "model.model.23.cv2.2.0.conv.weight", "model.model.23.cv2.2.0.bn.weight", "model.model.23.cv2.2.0.bn.bias", "model.model.23.cv2.2.0.bn.running_mean", "model.model.23.cv2.2.0.bn.running_var", "model.model.23.cv2.2.1.conv.weight", "model.model.23.cv2.2.1.bn.weight", "model.model.23.cv2.2.1.bn.bias", "model.model.23.cv2.2.1.bn.running_mean", "model.model.23.cv2.2.1.bn.running_var", "model.model.23.cv2.2.2.weight", "model.model.23.cv2.2.2.bias", "model.model.23.cv3.0.0.0.conv.weight", "model.model.23.cv3.0.0.0.bn.weight", "model.model.23.cv3.0.0.0.bn.bias", "model.model.23.cv3.0.0.0.bn.running_mean", "model.model.23.cv3.0.0.0.bn.running_var", "model.model.23.cv3.0.0.1.conv.weight", "model.model.23.cv3.0.0.1.bn.weight", "model.model.23.cv3.0.0.1.bn.bias", "model.model.23.cv3.0.0.1.bn.running_mean", "model.model.23.cv3.0.0.1.bn.running_var", "model.model.23.cv3.0.1.0.conv.weight", "model.model.23.cv3.0.1.0.bn.weight", "model.model.23.cv3.0.1.0.bn.bias", "model.model.23.cv3.0.1.0.bn.running_mean", "model.model.23.cv3.0.1.0.bn.running_var", "model.model.23.cv3.0.1.1.conv.weight", "model.model.23.cv3.0.1.1.bn.weight", "model.model.23.cv3.0.1.1.bn.bias", "model.model.23.cv3.0.1.1.bn.running_mean", "model.model.23.cv3.0.1.1.bn.running_var", "model.model.23.cv3.0.2.weight", "model.model.23.cv3.0.2.bias", "model.model.23.cv3.1.0.0.conv.weight", "model.model.23.cv3.1.0.0.bn.weight", "model.model.23.cv3.1.0.0.bn.bias", "model.model.23.cv3.1.0.0.bn.running_mean", "model.model.23.cv3.1.0.0.bn.running_var", "model.model.23.cv3.1.0.1.conv.weight", "model.model.23.cv3.1.0.1.bn.weight", "model.model.23.cv3.1.0.1.bn.bias", "model.model.23.cv3.1.0.1.bn.running_mean", "model.model.23.cv3.1.0.1.bn.running_var", "model.model.23.cv3.1.1.0.conv.weight", "model.model.23.cv3.1.1.0.bn.weight", "model.model.23.cv3.1.1.0.bn.bias", "model.model.23.cv3.1.1.0.bn.running_mean", "model.model.23.cv3.1.1.0.bn.running_var", "model.model.23.cv3.1.1.1.conv.weight", "model.model.23.cv3.1.1.1.bn.weight", "model.model.23.cv3.1.1.1.bn.bias", "model.model.23.cv3.1.1.1.bn.running_mean", "model.model.23.cv3.1.1.1.bn.running_var", "model.model.23.cv3.1.2.weight", "model.model.23.cv3.1.2.bias", "model.model.23.cv3.2.0.0.conv.weight", "model.model.23.cv3.2.0.0.bn.weight", "model.model.23.cv3.2.0.0.bn.bias", "model.model.23.cv3.2.0.0.bn.running_mean", "model.model.23.cv3.2.0.0.bn.running_var", "model.model.23.cv3.2.0.1.conv.weight", "model.model.23.cv3.2.0.1.bn.weight", "model.model.23.cv3.2.0.1.bn.bias", "model.model.23.cv3.2.0.1.bn.running_mean", "model.model.23.cv3.2.0.1.bn.running_var", "model.model.23.cv3.2.1.0.conv.weight", "model.model.23.cv3.2.1.0.bn.weight", "model.model.23.cv3.2.1.0.bn.bias", "model.model.23.cv3.2.1.0.bn.running_mean", "model.model.23.cv3.2.1.0.bn.running_var", "model.model.23.cv3.2.1.1.conv.weight", "model.model.23.cv3.2.1.1.bn.weight", "model.model.23.cv3.2.1.1.bn.bias", "model.model.23.cv3.2.1.1.bn.running_mean", "model.model.23.cv3.2.1.1.bn.running_var", "model.model.23.cv3.2.2.weight", "model.model.23.cv3.2.2.bias", "model.model.23.dfl.conv.weight". Unexpected key(s) in state_dict: "nc", "scales", "backbone", "head".
08-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值