sunshineatnoon / LinearStyleTransfer

This is the Pytorch implementation of "Learning Linear Transformations for Fast Image and Video Style Transfer" (CVPR 2019).
https://sites.google.com/view/linear-style-transfer-cvpr19/
BSD 2-Clause "Simplified" License
379 stars 88 forks source link

No attribute 'gaterecurrent2dnoind_forward_cuda' #3

Closed lQingRu closed 5 years ago

lQingRu commented 5 years ago

May I know what is the issue? My configuration is: cuda9.1 (I don't have cuda8.0), pytorch 0.4.1, python 3.6.8

== Starting run at Tue Sep  3 22:20:58 SGT 2019
== Job ID: 157471
== Node list: node19
== Submit dir. : /home/user/repository/image_enhancement/LinearStyleTransfer
/home/user/miniconda3/envs/linearST/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:177: UserWarning: nn.UpsamplingNearest2d is deprecated. Use nn.functional.interpolate instead.
  warnings.warn("nn.UpsamplingNearest2d is deprecated. Use nn.functional.interpolate instead.")
/home/user/miniconda3/envs/linearST/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:122: UserWarning: nn.Upsampling is deprecated. Use nn.functional.interpolate instead.
  warnings.warn("nn.Upsampling is deprecated. Use nn.functional.interpolate instead.")
/home/user/miniconda3/envs/linearST/lib/python3.6/site-packages/torch/nn/functional.py:1961: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  "See the documentation of nn.Upsample for details.".format(mode))
----------------- Options ---------------
                batchSize: 1                             
              contentPath: data/photo_real/content/images/
           contentSegPath: data/photo_real/contentSeg/   
                     cuda: True                          
              decoder_dir: models/dec_r41.pth            
                 fineSize: 512                           
                    layer: r41                           
               matrixPath: models/r41.pth                
                     outf: PhotoReal/                    
                  spn_dir: models/r41_spn.pth            
                stylePath: data/photo_real/style/images/ 
             styleSegPath: data/photo_real/styleSeg/     
                  vgg_dir: models/vgg_r41.pth            
----------------- End -------------------
<module 'libs.pytorch_spn._ext.gaterecurrent2dnoind' from '/home/user/repository/image_enhancement/LinearStyleTransfer/libs/pytorch_spn/_ext/gaterecurrent2dnoind/__init__.py'>
--------------
Traceback (most recent call last):
  File "TestPhotoReal.py", line 105, in <module>
    filtered = spn(transfer,whitenV)
  File "/home/user/miniconda3/envs/linearST/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/user/repository/image_enhancement/LinearStyleTransfer/libs/SPN.py", line 138, in forward
    out1 = self.left_right(X,G[0],G[1],G[2])
  File "/home/user/miniconda3/envs/linearST/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/user/repository/image_enhancement/LinearStyleTransfer/libs/SPN.py", line 29, in forward
    return self.propagator(x,G1,G2,G3)
  File "/home/user/miniconda3/envs/linearST/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/user/repository/image_enhancement/LinearStyleTransfer/libs/pytorch_spn/modules/gaterecurrent2dnoind.py", line 12, in forward
    return GateRecurrent2dnoindFunction(self.horizontal, self.reverse)(X, G1, G2, G3)
  File "/home/user/repository/image_enhancement/LinearStyleTransfer/libs/pytorch_spn/functions/gaterecurrent2dnoind.py", line 22, in forward
    gaterecurrent2d.gaterecurrent2dnoind_forward_cuda(self.horizontal, self.reverse, X, G1, G2, G3, output)
AttributeError: module 'libs.pytorch_spn._ext.gaterecurrent2dnoind' has no attribute 'gaterecurrent2dnoind_forward_cuda'
sunshineatnoon commented 5 years ago

Can you successfully run this?

cd libs/pytorch_spn
sh make.sh
cd ../..
lQingRu commented 5 years ago

Yes, I ran the codes in make.sh line by line while changing the CUDA_PATH to my own's . Had to run them line by line as I could not run a bash script since I do not have root access .

isalirezag commented 5 years ago

sounds like the problem is due to cuda version and inconsistency with pytorch