引导式测验 · 中等 等级

模型序列化格式测验

测试序列化可移植性、pickle 安全性、仅张量权重文件以及跨运行时导出模型的验证。

相关引导路径模型序列化格式
问题 1 的 8

为什么 Python 的 pickle 格式被认为是模型的安全风险?

预览每个问题8 问题

当您参加测验时,就会出现答案和解释。

  1. 为什么 Python 的 pickle 格式被认为是模型的安全风险?
    • 加载它可以执行文件中嵌入的任意代码
    • 它压缩文件太多
    • 只在周末有效
    • 它删除了原始模型
  2. ONNX 格式的主要优点是什么?
    • 这是尽可能最小的格式
    • 它允许在一个框架中训练的模型在许多其他运行时和语言中运行
    • 只能在PyTorch中打开
    • 它会自动提高准确性
  3. 为什么安全张量在共享模型权重方面变得流行?
    • 为了方便起见,它在加载时运行代码
    • 这是最古老的可用格式
    • 它仅安全地存储张量数据,具有快速内存可映射加载且无需执行代码
    • 它只存储模型精度
  4. GGUF 与哪个用例最相关?
    • 存储电子表格
    • 加密电子邮件
    • 在云中从头开始训练模型
    • 在本地硬件上高效运行量化大语言模型
  5. 像 ONNX 这样的交换格式主要存储什么?
    • 标准化计算图和模型的权重
    • 培训过程视频
    • 仅训练数据集
    • 开发者源码注释
  6. When exporting a Keras 3 model for TensorFlow serving, which directory format can model.export produce?
    • GGUF
    • 保存的模型
    • CSV
    • A pickle file containing the entire Python application
  7. After exporting a model to ONNX for a new runtime, what should the team check?
    • That the ONNX file guarantees identical speed on every device
    • That the export automatically includes the original training data
    • That supported operators run and outputs match the reference model on representative inputs
    • That no preprocessing code is needed
  8. Why can a state-dictionary checkpoint be preferable to loading a whole Python object from an untrusted file?
    • It guarantees the model architecture is embedded
    • It makes every checkpoint safe regardless of loader and version
    • It automatically converts the model to ONNX
    • It can load tensor state without reconstructing arbitrary pickled Python objects, subject to the loader’s security settings