Error: could not convert ‘c10::nullopt’ from ‘const c10::nullopt_t’ to ‘c10::optional<c10::MemoryFormat>’ Error occurs in Make period

version:
cuda: 11.3
cudnn: cudnn-11.3-linux-x64-v8.2.1.32
libtorch: libtorch-shared-with-deps-1.11.0+cu113
python: 3.8

The following is cmakelist:

cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project(libtorch_test)
message(STATUS "${CMAKE_CUDA_ARCHITECTURES}")
set(CMAKE_CUDA_ARCHITECTURES 70 75 80)
set(CUDNN_LIBRARY_PATH "/usr/local/cuda-11.3/lib64")
set(CUDNN_INCLUDE_PATH "/usr/local/cuda-11.3/include")
message(STATUS "SET SUCESSFUL!")
message(STATUS "${CMAKE_CUDA_ARCHITECTURES}")
set(CMAKE_PREFIX_PATH "/home/liangxijie/Lib/libtorch-shared-with-deps-1.11.0+cu113/libtorch/share/cmake/Torch")
find_package(Torch REQUIRED)
message(STATUS "Pytorch status:")
message(STATUS "libraries: ${TORCH_LIBRARIES}")
add_executable(libtorch_test deploy.cpp)
target_link_libraries(libtorch_test "${TORCH_LIBRARIES}")
set_property(TARGET libtorch_test PROPERTY CXX_STANDARD 11)

have you got it?I miss the same problem,hope your help

@zww_0108 Sorry, I solved this problem by using vs, and I just set some configurations in vs. Thus, I think you could look through the procedure of installing libtorch in vs on win and find out how these configurations are set on CMake.