it throws: Torch Script Not found: torch;torch_library;C10_LIBRARY
code:
cmake_minimum_required(VERSION 3.5)
project(HappySugarLife)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_PREFIX_PATH ${Torch_DIR})
find_package(Torch REQUIRED)
set(SOURCE_FILES main.cpp)
set(Torch_DIR libtorch/share/cmake/Torch)
add_executable( HappySugarLife ${SOURCE_FILES} libtorch/lib)
target_link_libraries( HappySugarLife “${TORCH_LIBRARIES}”)

image985×922 52.4 KB


image1219×752 43.5 KB

Here are the solutions that I have tried:

  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      Could not find a package configuration file provided by "Torch" with any of   the following names: 5
    

    
      
        opened 
        
          
        
        Oct 8, 2018
      
      


      
        
          
          jinfagang
        
      
    
  



  C++ build documentation seems has code bugs:
Simply following the tutorial of newest libtorch doc, just got errors.
CMake Error at CMakeLists.txt:5 (find_package):
...





  
  
    
    
  
  



  
      github.com/hughperkins/pytorch
  
  
    
  
	  
  

  
    
      CMake Warning at CMakeLists.txt:48 (FIND_PACKAGE):
    

    
      
        opened 
        
          
        
        Apr 26, 2017
      
      

        
          closed 
        
          
        
        Apr 26, 2017
      
        

      
        
          
          ahmedmazari
        
      
    
  



  Hello,
My error is related to line 48 from this file code https://github.com/SeanNaren/warp-ctc/blob/pytorch_bindings/CMakeLists.txt
After installing pytorch corrctly. l want to install the Fast...





  
  
    
    
  
  



  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      Building libtorch-dependent project with CMake 2
    

    
      
        opened 
        
          
        
        Feb 25, 2019
      
      

        
          closed 
        
          
        
        Feb 26, 2019
      
        

      
        
          
          hengyuan-hu
        
      
    
  



  ❓ Questions and Help
I am writing a library depending mainly on torch::Tensor in libtorch. The library will have a python interface...





  
  
    
    
  
  



  
      github.com/nagadomi/waifu2x
  
  
    
  
	  
  

  
    
      Cant Install Torch Ubuntu 18.04 and CUDA 10.0
    

    
      
        opened 
        
          
        
        Oct 5, 2018
      
      

        
          closed 
        
          
        
        Dec 8, 2018
      
        

      
        
          
          Archit01
        
      
    
  



  `Prefix set to /home/archit/torch/install
Installing Lua version: LUAJIT21
Found CUDA on your machine. Installing CMake 3.6 modules to get up-to-date FindCUDA
-- Configuring done
--...





  
  
    
    
  
  



  
      github.com/pytorch/pytorch
  
  
    
  
	  
  

  
    
      [libtorch] build failed with opencv-4.0.0 using cmake (CPU and GPU)
    

    
      
        opened 
        
          
        
        Dec 2, 2018
      
      

        
          closed 
        
          
        
        Dec 4, 2018
      
        

      
        
          
          Oldpan
        
      
    
  



  🐛 Bug
I think it's a small problem but I still can't future it out ..I want to accomplish inference feature using...



    module: build
    module: cpp
    topic: abi


  
  
    
    
  
  



  
    
    
    Cmake problem minimal example for c++ frontend C++
  
  
    I found a solution : for some reasons the function 

find_library(TORCH_LIBRARY torch PATHS “${TORCH_INSTALL_PREFIX}/lib”) 

in the torchConfig.cmake file wasn’t working. 
I just added 

set(TORCH_LIBRARY, “${TORCH_INSTALL_PREFIX}/lib/libtorch.so”) 

below and it worked like a charm.
  


All failed to slove this problem.