Code Monkey home page Code Monkey logo

dall-e's Introduction

Overview

[Blog] [Paper] [Model Card] [Usage]

This is the official PyTorch package for the discrete VAE used for DALL·E.

Installation

Before running the example notebook, you will need to install the package using

pip install git+https://github.com/openai/DALL-E.git

Exporting VAE Weights

Run export_weights.py:

git clone https://github.com/shawwn/DALL-E
cd DALL-E
python3 export_weights.py

That will create files in your current directory like:

  encoder.blocks.input.w.shape.256.3.7.7
  encoder.blocks.input.b.shape.256
  encoder.blocks.group_1.block_1.res_path.conv_1.w.shape.64.256.3.3
  encoder.blocks.group_1.block_1.res_path.conv_1.b.shape.64
  encoder.blocks.group_1.block_1.res_path.conv_2.w.shape.64.64.3.3
  encoder.blocks.group_1.block_1.res_path.conv_2.b.shape.64
  ...  

  decoder.blocks.group_1.block_1.id_path.b.shape.2048
  decoder.blocks.group_1.block_1.id_path.w.shape.2048.128.1.1
  decoder.blocks.group_1.block_1.res_path.conv_1.b.shape.512
  decoder.blocks.group_1.block_1.res_path.conv_1.w.shape.512.128.1.1
  decoder.blocks.group_1.block_1.res_path.conv_2.b.shape.512
  decoder.blocks.group_1.block_1.res_path.conv_2.w.shape.512.512.3.3
  ...  

Each file is an array of floats. For example, the file encoder.blocks.input.b.shape.256 contains exactly 256 * sizeof(float) bytes of data.

You can read each file into whatever framework you want, reshaping the array to the shape specified in the filename. For example, encoder.blocks.group_1.block_1.res_path.conv_1.w.shape.64.256.3.3 should be treated as a float32 tensor of shape [64,256,3,3].

dall-e's People

Contributors

adityaramesh avatar shawwn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.