Skip to content

Commit 0c5d704

Browse files
committed
Improve readme for cpp/custom-dataset and cpp/dcgan
1 parent a537659 commit 0c5d704

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cpp/custom-dataset/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $ make
2020

2121
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/).
2222

23-
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.
23+
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)).
2424

2525
The build directory should look like this:
2626

cpp/dcgan/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ with the PyTorch C++ frontend.
55

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

8+
You can find the commands to install argparse [here](https://github.com/pytorch/examples/blob/main/.github/workflows/main_cpp.yml#L34).
9+
810
To build the code, run the following commands from your terminal:
911

1012
```shell
@@ -46,6 +48,14 @@ $ ./dcgan
4648
...
4749
```
4850

51+
We can also specify the `--epochs` to change the number of epochs to train as follows:
52+
53+
```shell
54+
$ ./dcgan --epochs 10
55+
```
56+
Without specifying the `--epochs` flag, the default number of epochs to train is 30.
57+
58+
4959
The training script periodically generates image samples. Use the
5060
`display_samples.py` script situated in this folder to generate a plot image.
5161
For example:

0 commit comments

Comments
 (0)