cs231n [collectSubmission.sh/makepdf.py] FileNotFoundError: [Errno 2] No such file or directory: 'knn.pdf'

2024. 12. 12. 21:18·Error
반응형

cs231n 과제 제출을 위해 .ipynb, .py 파일들을 pdf로 변환하고자 collect_submission.ipynb 파일을 실행시켰는데 오류가 발생합니다.

 

[문제 해결]

처음 collectSubmission.sh를 실행하기 이전에 pandoc 라이브러리도 같이 설치하면서 해결할 수 있습니다.

%cd drive/MyDrive
%cd $FOLDERNAME
!sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic
!pip install PyPDF2
!sudo apt-get install pandoc
!bash collectSubmission.sh

[문제점 찾기]

%cd drive/MyDrive
%cd $FOLDERNAME
!sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic
!pip install PyPDF2
!bash collectSubmission.

# FileNotFoundError: [Errno 2] No such file or directory: 'knn.pdf'

 

코드를 확인해보면 pdf를 병합하는 과정에서 pdf가 존재하지 않다고 합니다.

 

pdf를 만드는 코드는 아래와 같습니다.

for f in files:
    os_args.append(f)
    subprocess.run(os_args)
    print("Created PDF {}.".format(f))

 

이 코드는 ipynb, py 파일을 pdf로 변환해주는 코드입니다.

 

에러를 확인해 보기 위해 collect_submission.ipynb 파일에 셀을 하나 만들어서 다음 터미널 코드를 통해 문제를 확인해줍니다.

 

!jupyter nbconvert --to pdf knn.ipynb --log-level DEBUG

>> File "/usr/local/lib/python3.10/dist-packages/nbconvert/filters/pandoc.py", line 36, in convert_pandoc
    return pandoc(source, from_format, to_format, extra_args=extra_args)
  File "/usr/local/lib/python3.10/dist-packages/nbconvert/utils/pandoc.py", line 50, in pandoc
    check_pandoc_version()
  File "/usr/local/lib/python3.10/dist-packages/nbconvert/utils/pandoc.py", line 98, in check_pandoc_version
    v = get_pandoc_version()
  File "/usr/local/lib/python3.10/dist-packages/nbconvert/utils/pandoc.py", line 75, in get_pandoc_version
    raise PandocMissing()
nbconvert.utils.pandoc.PandocMissing: Pandoc wasn't found.
Please check that pandoc is installed:
https://pandoc.org/installing.html
[NbConvertApp] Exiting application: jupyter-nbconvert

 

pandoc 이라는 라이브러리를 설치해야 하나 봅니다.

 

!sudo apt-get install pandoc

 

 

이제 다시 collectSubmission.sh를 실행시켜 보면, pdf가 잘 생성됩니다.

반응형

'Error' 카테고리의 다른 글

Error(s) in loading state_dict for model: Missing Key(s) in state_dict: "xxxx", Unexpected Key(s) in state_dict: "aa.xxxx"  (0) 2024.03.15
RuntimeError: CUDA error: out of memoryCUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.For debugging consider passing CUDA_LAUNCH_BLOCKING=1.Compile with `TORCH_USE_CUDA_DSA` to enab..  (0) 2024.03.11
The remote host may not meet VS Code Server's prerequisites for glibc and libstdc++  (0) 2024.02.11
'Error' 카테고리의 다른 글
  • Error(s) in loading state_dict for model: Missing Key(s) in state_dict: "xxxx", Unexpected Key(s) in state_dict: "aa.xxxx"
  • RuntimeError: CUDA error: out of memoryCUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.For debugging consider passing CUDA_LAUNCH_BLOCKING=1.Compile with `TORCH_USE_CUDA_DSA` to enab..
  • The remote host may not meet VS Code Server's prerequisites for glibc and libstdc++
hangyuwon
hangyuwon
  • hangyuwon
    191
    hangyuwon
  • 전체
    오늘
    어제
  • 글쓰기 관리
    • 분류 전체보기 (38)
      • 기타 (1)
      • Stanford CS231n (19)
      • 논문 리뷰 (5)
      • Error (4)
      • 알고리즘 (2)
      • Linux (1)
      • 잡동사니 (2)
      • 딥러닝 (4)
  • 인기 글

  • 태그

    error
    논문 리뷰
    알고리즘
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
hangyuwon
cs231n [collectSubmission.sh/makepdf.py] FileNotFoundError: [Errno 2] No such file or directory: 'knn.pdf'
상단으로

티스토리툴바