Skip to content

Commit

Permalink
Improve readme for cpp/custom-dataset and cpp/dcgan (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
lancerts authored Jan 25, 2024
1 parent a537659 commit 76cd9d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/custom-dataset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ make

where /path/to/libtorch should be the path to the unzipped LibTorch distribution, which you can get from the [PyTorch homepage](https://pytorch.org/get-started/locally/).

if you see an error like `undefined reference to cv::imread(std::string const&, int)` when running the `make` command, you should build LibTorch from source using the instructions [here](https://github.com/pytorch/pytorch#from-source), and then set `CMAKE_PREFIX_PATH` to that PyTorch source directory.
If you see an error like `undefined reference to cv::imread(std::string const&, int)` when running the `make` command, you should build LibTorch from source using the instructions [here](https://github.com/pytorch/pytorch#from-source), and then set `CMAKE_PREFIX_PATH` to that PyTorch source directory. An alternative solution is to use `libtorch-cxx11-abi-shared-with-deps` instead of `libtorch-shared-with-deps` as the latter is not compatible with openCV (reported [here](https://discuss.pytorch.org/t/library-conflict-between-libtorch-and-opencv/64489)).

The build directory should look like this:

Expand Down
10 changes: 10 additions & 0 deletions cpp/dcgan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ with the PyTorch C++ frontend.

The entire training code is contained in `dcgan.cpp`.

You can find the commands to install argparse [here](https://github.com/pytorch/examples/blob/main/.github/workflows/main_cpp.yml#L34).

To build the code, run the following commands from your terminal:

```shell
Expand Down Expand Up @@ -46,6 +48,14 @@ $ ./dcgan
...
```

We can also specify the `--epochs` to change the number of epochs to train as follows:

```shell
$ ./dcgan --epochs 10
```
Without specifying the `--epochs` flag, the default number of epochs to train is 30.


The training script periodically generates image samples. Use the
`display_samples.py` script situated in this folder to generate a plot image.
For example:
Expand Down

0 comments on commit 76cd9d0

Please sign in to comment.