FATE icon indicating copy to clipboard operation
FATE copied to clipboard

FATE1.6 homo_nn进行预测出现OSerror,如何解决?

Open heroding77 opened this issue 3 years ago • 1 comments

FATE1.6版本的v1操作,自定义全连接神经网络进行手写数字识别训练,在单独预测阶段出现错误,如下所示: 069d04d8901b6c8f8c9d66752c8835a keras版本为2.2.5 TensorFlow版本为1.14.0 训练阶段的conf和dsl以及预测阶段的conf如下: homo_dense_conf.json


{
  "initiator": {
    "role": "guest",
    "party_id": 10000
  },
  "job_parameters": {
    "work_mode": 0
  },
  "role": {
    "guest": [
      10000
    ],
    "host": [
      10000
    ],
    "arbiter": [
      10000
    ]
  },
  "role_parameters": {
    "guest": {
      "args": {
        "data": {
          "train_data": [
            {
              "name": "homo_mnist_2_train",
              "namespace": "homo_guest_mnist_train"
            }
          ]
        }
      },
      "dataio_0": {
      "with_label": [true],
      "label_name": ["y"],
      "label_type": ["int"],
      "output_format": ["dense"]
      }
    },
    "host": {
      "args": {
        "data": {
          "train_data": [
            {
              "name": "homo_mnist_1_train",
              "namespace": "homo_host_mnist_train"
            }
          ]
        }
      },
      "dataio_0": {
      "with_label": [true],
      "label_name": ["y"],
      "label_type": ["int"],
      "output_format": ["dense"]
      }
    }
  },
  "algorithm_parameters": {
    "homo_nn_0": {
      "config_type": "keras",
      "nn_define": {"class_name": "Sequential", "config": {"name": "sequential_1", "layers": [{"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "batch_input_shape": [null, 784], "dtype": "float32", "units": 128, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 32, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_3", "trainable": true, "dtype": "float32", "units": 10, "activation": "softmax", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}]}, "keras_version": "2.2.5", "backend": "tensorflow"},
      "encode_label": true,
      "batch_size": 100,
      "optimizer": {
        "optimizer": "Adam",
        "learning_rate": 0.05
      },
      "early_stop": {
        "early_stop": "diff",
        "eps": 1e-5
      },
      "loss": "categorical_crossentropy",
      "metrics": [
        "accuracy"
      ],
      "max_iter": 20
    },
    "evaluation_0": {
      "eval_type": "multi"
    }
  }
}

homo_dense_dsl.json

{
  "components": {
    "dataio_0": {
      "module": "DataIO",
      "input": {
        "data": {
          "data": [
            "args.train_data"
          ]
        }
      },
      "output": {
        "data": [
          "train"
        ],
        "model": [
          "dataio"
        ]
      }
    },
    "homo_nn_0": {
      "module": "HomoNN",
      "input": {
        "data": {
          "train_data": [
            "dataio_0.train"
          ]
        }
      },
      "output": {
        "data": [
          "train"
        ],
        "model": [
          "homo_nn"
        ]
      }
    },
    "evaluation_0": {
      "module": "Evaluation",
      "input": {
        "data": {
	  "data": ["homo_nn_0.train"]
	}
      }   
    }
  }
}

homo_dense_predict_conf.json

{
  "initiator": {
    "role": "guest",
    "party_id": 10000
  },
  "job_parameters": {
    "work_mode": 0,
    "job_type": "predict",
    "model_id": "arbiter-10000#guest-10000#host-10000#model",
    "model_version": "2022042507025538677125"
  },
  "role": {
    "guest": [
      10000
    ],
    "host": [
      10000
    ],
    "arbiter": [
      10000
    ]
  },
  "role_parameters": {
    "guest": {
      "args": {
        "data": {
          "eval_data": [
            {
              "name": "homo_mnist_2_test",
              "namespace": "homo_guest_mnist_test"
            }
          ]
        }
      },
      "dataio_0": {
      "with_label": [true],
      "label_name": ["y"],
      "label_type": ["int"],
      "output_format": ["dense"]
      }
    },
    "host": {
      "args": {
        "data": {
          "eval_data": [
            {
              "name": "homo_mnist_1_test",
              "namespace": "homo_host_mnist_test"
            }
          ]
        }
      },
      "dataio_0": {
      "with_label": [true],
      "label_name": ["y"],
      "label_type": ["int"],
      "output_format": ["dense"]
      }
    }
  },
  "algorithm_parameters": {
    "homo_nn_0": {
      "config_type": "keras",
      "nn_define": {"class_name": "Sequential", "config": {"name": "sequential_1", "layers": [{"class_name": "Dense", "config": {"name": "dense_1", "trainable": true, "batch_input_shape": [null, 784], "dtype": "float32", "units": 128, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true, "dtype": "float32", "units": 32, "activation": "relu", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}, {"class_name": "Dense", "config": {"name": "dense_3", "trainable": true, "dtype": "float32", "units": 10, "activation": "softmax", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "kernel_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "bias_constraint": null}}]}, "keras_version": "2.2.5", "backend": "tensorflow"},
      "encode_label": true,
      "batch_size": 100,
      "optimizer": {
        "optimizer": "Adam",
        "learning_rate": 0.05
      },
      "early_stop": {
        "early_stop": "diff",
        "eps": 1e-5
      },
      "loss": "categorical_crossentropy",
      "metrics": [
        "accuracy"
      ],
      "max_iter": 20
    },
    "evaluation_0": {
      "eval_type": "multi"
    }
  }
}

heroding77 avatar Apr 27 '22 05:04 heroding77

请问您在上传mnist任务时,又遇到这个错误吗?json.decoder.JSONDecodeError: Expecting ',' delimiter: line 48 column 1 (char 719)

gaolje avatar Jun 06 '22 13:06 gaolje