10 Matching Annotations
  1. Mar 2023
    1. For example, if you are using TensorFlow, you might save your model as a .h5 file using the Keras API. If you are using PyTorch, you might save your model as a .pt file using the torch.save() function. By saving your model as a file, you can easily load it into a deployment environment (such as FastAPI) and use it to make predictions on new images
  2. Sep 2021
  3. Jan 2021
    1. Keras is a user centric library whereas Tensorflow especially Tensorflow 1.0 is a machine centric library. ML researchers think in terms of terms of layers, automatic differentiation engines think in terms of computational graphs.As far as I’m concerned my time is more valuable than the cycles of a machine so I’d rather use something like Keras.

      Why simplicity of Keras is important

  4. Mar 2020
    1. vectors here have length 7 instead of 6 because of the extra 0 element at the beginning. This is an inconsequential detail - Keras reserves index 0 and never assigns it to any word.

      Keras always reserves 0 and never assigns any word to it; therefore, even when we have 6 words, we end up with the length of 7:

      [0. 1. 1. 1. 0. 0. 0.]

  5. Sep 2018
    1. 注意 keras 处理 CNN 的形状

      在 keras 中 fit 给 CNN 的数据集的形状必须是:

      theano: (-1, channel, height, width)

      tensorflow: (-1, height, width, channel)

      如果不是必须reshape到这个形状,第一层卷积层的声明一般为:

      model.add( Conv2D(kernelNum, (kernelHeight, kernelWidth), input_shape=(dataPointChannel, dataPointHeight, dataPointWidth), data_format='channels_first'))

      切记,切记

    1. @mingrutar - Correction: config = tf.ConfigProto() config.gpu_options.allow_growth = True session = tf.Session(config=config)

      当运行 keras 进行模型训练时,如果遇到以下错误:

      failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED

      可以添加这样的语句,如此之后可以正常运行了。