Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve readme for cpp/custom-dataset and cpp/dcgan #1223

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading