{"action":"created","issue":{"url":"https://api.github.com/repos/naoto0804/pytorch-inpainting-with-partial-conv/issues/19","repository_url":"https://api.github.com/repos/naoto0804/pytorch-inpainting-with-partial-conv","labels_url":"https://api.github.com/repos/naoto0804/pytorch-inpainting-with-partial-conv/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/naoto0804/pytorch-inpainting-with-partial-conv/issues/19/comments","events_url":"https://api.github.com/repos/naoto0804/pytorch-inpainting-with-partial-conv/issues/19/events","html_url":"https://github.com/naoto0804/pytorch-inpainting-with-partial-conv/issues/19","id":360755760,"node_id":"MDU6SXNzdWUzNjA3NTU3NjA=","number":19,"title":"train.py error","user":{"login":"123liluky","id":20832778,"node_id":"MDQ6VXNlcjIwODMyNzc4","avatar_url":"https://avatars0.githubusercontent.com/u/20832778?v=4","gravatar_id":"","url":"https://api.github.com/users/123liluky","html_url":"https://github.com/123liluky","followers_url":"https://api.github.com/users/123liluky/followers","following_url":"https://api.github.com/users/123liluky/following{/other_user}","gists_url":"https://api.github.com/users/123liluky/gists{/gist_id}","starred_url":"https://api.github.com/users/123liluky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/123liluky/subscriptions","organizations_url":"https://api.github.com/users/123liluky/orgs","repos_url":"https://api.github.com/users/123liluky/repos","events_url":"https://api.github.com/users/123liluky/events{/privacy}","received_events_url":"https://api.github.com/users/123liluky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-17T07:49:34Z","updated_at":"2018-09-20T08:45:26Z","closed_at":null,"author_association":"NONE","body":"After installing torch0.4 in python3.6, I run the train.py. At the beginning, error was \r\n![image](https://user-images.githubusercontent.com/20832778/45611162-fdbed880-ba90-11e8-9b39-b8a8a174018f.png)\r\nSo, I add interplolate copy from net like below into functional.py\r\n\r\ndef interpolate(input, size=None, scale_factor=None, mode='nearest', align_corners=None):\r\n    r\"\"\"Down/up samples the input to either the given :attr:`size` or the given\r\n    :attr:`scale_factor`\r\n    The algorithm used for interpolation is determined by :attr:`mode`.\r\n    Currently temporal, spatial and volumetric sampling are supported, i.e.\r\n    expected inputs are 3-D, 4-D or 5-D in shape.\r\n    The input dimensions are interpreted in the form:\r\n    `mini-batch x channels x [optional depth] x [optional height] x width`.\r\n    The modes available for resizing are: `nearest`, `linear` (3D-only),\r\n    `bilinear` (4D-only), `trilinear` (5D-only), `area`\r\n    Args:\r\n        input (Tensor): the input tensor\r\n        size (int or Tuple[int] or Tuple[int, int] or Tuple[int, int, int]):\r\n            output spatial size.\r\n        scale_factor (float or Tuple[float]): multiplier for spatial size. Has to match input size if it is a tuple.\r\n        mode (string): algorithm used for upsampling:\r\n            'nearest' | 'linear' | 'bilinear' | 'trilinear' | 'area'. Default: 'nearest'\r\n        align_corners (bool, optional): if True, the corner pixels of the input\r\n            and output tensors are aligned, and thus preserving the values at\r\n            those pixels. This only has effect when :attr:`mode` is `linear`,\r\n            `bilinear`, or `trilinear`. Default: False\r\n    .. warning::\r\n        With ``align_corners = True``, the linearly interpolating modes\r\n        (`linear`, `bilinear`, and `trilinear`) don't proportionally align the\r\n        output and input pixels, and thus the output values can depend on the\r\n        input size. This was the default behavior for these modes up to version\r\n        0.3.1. Since then, the default behavior is ``align_corners = False``.\r\n        See :class:`~torch.nn.Upsample` for concrete examples on how this\r\n        affects the outputs.\r\n    \"\"\"\r\n    from numbers import Integral\r\n    from .modules.utils import _ntuple\r\n    def _check_size_scale_factor(dim):\r\n        if size is None and scale_factor is None:\r\n            raise ValueError('either size or scale_factor should be defined')\r\n        if size is not None and scale_factor is not None:\r\n            raise ValueError('only one of size or scale_factor should be defined')\r\n        if scale_factor is not None and isinstance(scale_factor, tuple)\\\r\n                and len(scale_factor) != dim:\r\n            raise ValueError('scale_factor shape must match input shape. '\r\n                             'Input is {}D, scale_factor size is {}'.format(dim, len(scale_factor)))\r\n    def _output_size(dim):\r\n        _check_size_scale_factor(dim)\r\n        if size is not None:\r\n            return size\r\n        scale_factors = _ntuple(dim)(scale_factor)\r\n        # math.floor might return float in py2.7\r\n        return [int(math.floor(input.size(i + 2) * scale_factors[i])) for i in range(dim)]\r\n    if mode in ('nearest', 'area'):\r\n        if align_corners is not None:\r\n            raise ValueError(\"align_corners option can only be set with the \"\r\n                             \"interpolating modes: linear | bilinear | trilinear\")\r\n    else:\r\n        if align_corners is None:\r\n            warnings.warn(\"Default upsampling behavior when mode={} is changed \"\r\n                          \"to align_corners=False since 0.4.0. Please specify \"\r\n                          \"align_corners=True if the old behavior is desired. \"\r\n                          \"See the documentation of nn.Upsample for details.\".format(mode))\r\n            align_corners = False\r\n    if input.dim() == 3 and mode == 'nearest':\r\n        return torch._C._nn.upsample_nearest1d(input, _output_size(1))\r\n    elif input.dim() == 4 and mode == 'nearest':\r\n        return torch._C._nn.upsample_nearest2d(input, _output_size(2))\r\n    elif input.dim() == 5 and mode == 'nearest':\r\n        return torch._C._nn.upsample_nearest3d(input, _output_size(3))\r\n    elif input.dim() == 3 and mode == 'area':\r\n        return adaptive_avg_pool1d(input, _output_size(1))\r\n    elif input.dim() == 4 and mode == 'area':\r\n        return adaptive_avg_pool2d(input, _output_size(2))\r\n    elif input.dim() == 5 and mode == 'area':\r\n        return adaptive_avg_pool3d(input, _output_size(3))\r\n    elif input.dim() == 3 and mode == 'linear':\r\n        return torch._C._nn.upsample_linear1d(input, _output_size(1), align_corners)\r\n    elif input.dim() == 3 and mode == 'bilinear':\r\n        raise NotImplementedError(\"Got 3D input, but bilinear mode needs 4D input\")\r\n    elif input.dim() == 3 and mode == 'trilinear':\r\n        raise NotImplementedError(\"Got 3D input, but trilinear mode needs 5D input\")\r\n    elif input.dim() == 4 and mode == 'linear':\r\n        raise NotImplementedError(\"Got 4D input, but linear mode needs 3D input\")\r\n    elif input.dim() == 4 and mode == 'bilinear':\r\n        return torch._C._nn.upsample_bilinear2d(input, _output_size(2), align_corners)\r\n    elif input.dim() == 4 and mode == 'trilinear':\r\n        raise NotImplementedError(\"Got 4D input, but trilinear mode needs 5D input\")\r\n    elif input.dim() == 5 and mode == 'linear':\r\n        raise NotImplementedError(\"Got 5D input, but linear mode needs 3D input\")\r\n    elif input.dim() == 5 and mode == 'bilinear':\r\n        raise NotImplementedError(\"Got 5D input, but bilinear mode needs 4D input\")\r\n    elif input.dim() == 5 and mode == 'trilinear':\r\n        return torch._C._nn.upsample_trilinear3d(input, _output_size(3), align_corners)\r\n    else:\r\n        raise NotImplementedError(\"Input Error: Only 3D, 4D and 5D input Tensors supported\"\r\n                                  \" (got {}D) for the modes: nearest | linear | bilinear | trilinear\"\r\n                                  \" (got {})\".format(input.dim(), mode))\r\nNow the error is ![image](https://user-images.githubusercontent.com/20832778/45611050-b33d5c00-ba90-11e8-9640-4dd98863842d.png)   Could you help me?"},"comment":{"url":"https://api.github.com/repos/naoto0804/pytorch-inpainting-with-partial-conv/issues/comments/423097177","html_url":"https://github.com/naoto0804/pytorch-inpainting-with-partial-conv/issues/19#issuecomment-423097177","issue_url":"https://api.github.com/repos/naoto0804/pytorch-inpainting-with-partial-conv/issues/19","id":423097177,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzA5NzE3Nw==","user":{"login":"123liluky","id":20832778,"node_id":"MDQ6VXNlcjIwODMyNzc4","avatar_url":"https://avatars0.githubusercontent.com/u/20832778?v=4","gravatar_id":"","url":"https://api.github.com/users/123liluky","html_url":"https://github.com/123liluky","followers_url":"https://api.github.com/users/123liluky/followers","following_url":"https://api.github.com/users/123liluky/following{/other_user}","gists_url":"https://api.github.com/users/123liluky/gists{/gist_id}","starred_url":"https://api.github.com/users/123liluky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/123liluky/subscriptions","organizations_url":"https://api.github.com/users/123liluky/orgs","repos_url":"https://api.github.com/users/123liluky/repos","events_url":"https://api.github.com/users/123liluky/events{/privacy}","received_events_url":"https://api.github.com/users/123liluky/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T08:45:26Z","updated_at":"2018-09-20T08:45:26Z","author_association":"NONE","body":"I found above error was caused by setting --image_size=256 in train.py. Now I am wondering the meaning of the third and forth line of output images in snapshots/default/images."}}
{"actor":{"display_login":"123liluky"}}