ValueError: Cannot create group in read only mode.


原文鏈接:http://www.one2know.cn/bug7/

  • 報錯
Using TensorFlow backend.
Traceback (most recent call last):
  File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/2.Application中五款已訓練模型、VGG16框架(Sequential式、Model式)解讀/1.py", line 8, in <module>
    model = load_model(r'..\Model\resnet50_weights_tf_dim_ordering_tf_kernels.h5','rw')
  File "D:\Anaconda3\lib\site-packages\keras\engine\saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "D:\Anaconda3\lib\site-packages\keras\engine\saving.py", line 221, in _deserialize_model
    model_config = f['model_config']
  File "D:\Anaconda3\lib\site-packages\keras\utils\io_utils.py", line 302, in __getitem__
    raise ValueError('Cannot create group in read only mode.')
ValueError: Cannot create group in read only mode.
  • 原因
    單純的沒有結構一個model不能導入那么多參數
  • 解決
    model = AModel(weights=r'模型的路徑\model_name.h5')
    也可以:
    先加載model的layers,再加載模型


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 ValueError: must have exactly one of create/read/write/append mode hadoop mkdir: Cannot create directory /usr. Name node is in safe mode. hadoop上傳文件失敗報錯(put: Cannot create file/eclipse.desktop._COPYING_. Name node is in safe mode.) bash: cannot create temp file for here-document: Read-only file system create-react-app 遇到問題 TypeError: Cannot assign to read only property 'jsx' of object '#' ValueError: Could not find a format to read the specified file in mode 'i' cannot edit in read-only editor 徹底解決sql_mode=only_full_group_by MySQL報錯this is incompatible with sql_mode=only_full_group_by laravel sql mode only_full_group_by 解決小記
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM